请求帮助 Topic is solved

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

andypku

请求帮助  Topic is solved

16 May 2020, 00:59

我想在编辑文档的时候,每回车一次就输出一个系统时间hh:mm,这个利用autohotkey是否可以实现?
User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: 请求帮助

16 May 2020, 10:30

通过这种方式可以:

Code: Select all

Enter::
    FormatTime, Time, GGman, HH:mm
    SendInput, %time%
Return
但是,如果您希望它仅在特定的应用程序(例如记事本)中运行,则必须使用指令 #if

从而:

Code: Select all

#IfWinActive, Ahk_exe notepad.exe
    {
        Enter::
            FormatTime, Time, GGman, HH:mm
            SendInput, %time%
        Return
    }
#IfWinActive
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
garry
Posts: 3772
Joined: 22 Dec 2013, 12:50

Re: 请求帮助

17 May 2020, 08:29

var GGman is empty , if empty : a_now
example with languageCode , US-en = L0x0409

Code: Select all

;- 请求帮助 
;- https://www.autohotkey.com/boards/viewtopic.php?f=27&t=75997

;- example with languageCode
;- https://www.autohotkey.com/docs/misc/Languages.htm
;- https://www.science.co.il/language/Locale-codes.php

run,notepad
return
esc::exitapp

#IfWinActive, ahk_exe notepad.exe
~$f12::
    {
        Enter::
            FormatTime,Japan,L0x0411,dddd MMMM yyyy-MM-dd
            SendInput, %Japan%`n
        Return
    }
#IfWinActive
return

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 28 guests