Reputation: 131
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?
Upvotes: 0
Views: 56
Reputation: 10568
::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
Upvotes: 1
Reputation: 71
Are firstname and lastname variables?
If so, just use:
SendInput, % ClipBoard " " firstName " " lastName
Upvotes: 0