I have a python script copytimeinbuffer.py, and I need to run this with shift-f1 key. I used his script.

+F1::
Run "c:\bin\python27\python e:/copytimeinbuffer.py"
Send !{Space}ep
Return

However, I got this error message.

enter image description here

What's wrong with the script?

link|improve this question

74% accept rate
Somewhat unrelated note: Instead of sending !{Space}ep, you could use win32clipboard to read the clipboard contents. – grawity Sep 15 '11 at 16:10
@grawity : I did that to emulate '^V' as is answered in superuser.com/questions/196631/… - it doesn't work though. – prosseek Sep 15 '11 at 16:20
I know what !{Space}ep does. I also know that there are better ways to do the same thing than sending keypresses. – grawity Sep 15 '11 at 16:26
feedback

2 Answers

up vote 1 down vote accepted

Try removing the quotes from your Run argument. It could be that AHK is attempting to run a file named python e:/copytimeinbuffer.py, instead of just python. (The path to your .py file is a separate argument, and should not need to be quoted.)

link|improve this answer
Thanks for the answer. BTW, could you hint me why the print string in python isn't shown in the console? I asked about it in another post - superuser.com/questions/336509/… – prosseek Sep 16 '11 at 19:14
feedback

One thing what I found in running python script is that I needed to insert Sleep 100 before running the other AHK script.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.