Timing issue with autohotscript, fails to dump or open destination file
- by learnerforever
I've created a autohotscript to quickly dump selected text into my jot file on the Desktop and I think I'm facing a timing error.
The script works like thus:
Select text when reading a text file, browsing internet, reading PDF, etc.
Hit Ctrl + J
Contents of selected text is dumped into my jot file.
When I press Ctrl + J very quickly, it sometimes doesn't come up in my jot file and sometimes when I keep pressing Ctrl + J for a long time, many instances of the text appear.
Could somebody please point out what's wrong with this script and how I can improve it.
^j::
Clipboard := "" ; clear
Send, ^c ; simulate Ctrl+C (=selection in clipboard)
selection = %Clipboard% ; save the content of the clipboard
FileAppend, `n%selection%`n,C:\Users\jagrati\Desktop\jots.txt
return