我正在尝试添加日期戳,后跟姓,名 然后是文字。如:
::ABC::
FormatTime, ClipBoard,, dd-MMM-yyyy 'Last Name, First Name;'
ClipSaved := ClipboardAll
Clipboard =
(
Text
)
Send ^v
sleep 100
Clipboard := ClipSaved
ClipSaved =
return
但是它不起作用。我正在使用此版本,因为我需要它 可靠/不像以前那样用以下方式剪切文本:
::ABC::
Clipboard =
FormatTime, ClipBoard,, dd-MMM-yyyy'; Last Name, First Name; '
SendInput, %ClipBoard%
(
Text
)
Return
有什么想法吗?
答案 0 :(得分:1)
::ABC::
ClipSaved := ClipboardAll ; save the entire clipboard to the variable ClipSaved
Clipboard := "" ; empty the clipboard
; https://autohotkey.com/docs/commands/_EscapeChar.htm#Escape_Sequences
; ";" must be escaped
; quote ' must be enclosed in quotes
FormatTime, ClipBoard,, dd-MMM-yyyy '''''Last Name, First Name`;'''''
TextToAppend = ; append this text to the clipboard
(
Text
)
clipboard = %clipboard%%TextToAppend%
Send ^v
sleep 100
Clipboard := ClipSaved ; restore original clipboard
ClipSaved := "" ; free the memory
return
答案 1 :(得分:0)
名字和姓氏变量吗?
如果是这样,只需使用:
SendInput, % ClipBoard " " firstName " " lastName