简体   繁体   中英

How do I escape the '+' characters in an AutoHotKey, with the date script?

I use AutoHotKey to display actual date. here is the code :

:*C:]d::  ; This hotstring replaces "]d" with the current date and time via the commands below.
FormatTime, CurrentDateTime,, yyyy‑MM‑dd ‒ HH'H'mm '(UTC+1)' ; It will look like 2005-01-09 15H53 (UTC+1)
SendInput %CurrentDateTime%
return

But the result miss the '+', I used "`" or "", both not vrog.

Thank pro help. Good day and long and happy life.

Use the text send mode .

:*C:]d::  ; This hotstring replaces "]d" with the current date and time via the commands below.
    FormatTime, CurrentDateTime,, yyyy‑MM‑dd ‒ HH'H'mm '(UTC+1)' ; It will look like 2005-01-09 15H53 (UTC+1)
    SendInput, {Text}%CurrentDateTime%
return

Also, if you'd want to ditch the legacy AHK syntax, you'd do this:

:*C:]d::
    FormatTime, CurrentDateTime, , % "yyyy‑MM‑dd ‒ HH'H'mm '(UTC+1)'"
    SendInput, % "{Text}" CurrentDateTime
return

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM