Timing issue with autohotscript, fails to dump or open destination file

Posted by learnerforever on Super User See other posts from Super User or by learnerforever
Published on 2010-07-04T08:45:35Z Indexed on 2011/02/14 23:27 UTC
Read the original article Hit count: 432

Filed under:
|

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:

  1. Select text when reading a text file, browsing internet, reading PDF, etc.
  2. Hit Ctrl + J
  3. 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

© Super User or respective owner

Related posts about script

Related posts about autohotkey