使用 AutoHotKeys 快速添加日期戳和字符串
Add Date Stamp and a String Fast using AutoHotKeys
I am trying to add a date stamp followed by Last Name, First Name
followed by a text. Such as:
::ABC::
FormatTime, ClipBoard,, dd-MMM-yyyy 'Last Name, First Name;'
ClipSaved := ClipboardAll
Clipboard =
(
Text
)
Send ^v
sleep 100
Clipboard := ClipSaved
ClipSaved =
return
But it doesn't work. I am using this version because I need it to be
reliable/not cut the text as it has happened before with:
::ABC::
Clipboard =
FormatTime, ClipBoard,, dd-MMM-yyyy'; Last Name, First Name; '
SendInput, %ClipBoard%
(
Text
)
Return
Any ideas?
名字和姓氏是变量吗?
如果是这样,只需使用:
SendInput, % ClipBoard " " firstName " " lastName
::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
I am trying to add a date stamp followed by Last Name, First Name followed by a text. Such as:
::ABC::
FormatTime, ClipBoard,, dd-MMM-yyyy 'Last Name, First Name;'
ClipSaved := ClipboardAll
Clipboard =
(
Text
)
Send ^v
sleep 100
Clipboard := ClipSaved
ClipSaved =
return
But it doesn't work. I am using this version because I need it to be reliable/not cut the text as it has happened before with:
::ABC::
Clipboard =
FormatTime, ClipBoard,, dd-MMM-yyyy'; Last Name, First Name; '
SendInput, %ClipBoard%
(
Text
)
Return
Any ideas?
名字和姓氏是变量吗?
如果是这样,只需使用:
SendInput, % ClipBoard " " firstName " " lastName
::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