-4

Suppose I have x.ahk, which is an AutoHotKey file. I want to open it through my Sikuli program.

I tried the following methods:

openApp("F:\\folder\\x.ahk")

I got the following error

[info] VDictProxy loaded.
[log] App.open F:\folder\x.ahk(0)
[error] App.open failed: F:\folder\x.ahk not found

I tried using open() instead

open("F:\\folder\\x.ahk","r")

It did not throw any error from this, but it still did not open the file.

How can I launch my AutoHotKey script?

Nathaniel Waisbrot
  • 23,261
  • 7
  • 71
  • 99
Praveen kumar
  • 597
  • 2
  • 14
  • 26
  • 1
    Don't know much about sikuli, bit have you tried opening it through the actual compiler? Something like: `C:\Program Files\AutoHotkey\AutoHotkey.exe "F:\folder\x.ahk"`? Alternatively, you could compile your script first and then open it. – MCL Jun 07 '13 at 08:22
  • @MCL Thanks a lot it is working well now. Is there any command like this to close the autohotkey? – Praveen kumar Jun 07 '13 at 09:06
  • Closing it is a whole different thing. I bet sikuli is able to do that. If you're sure it's not, let me know and I'll show you how you could achieve it via command line. – MCL Jun 07 '13 at 14:52
  • One easy way of closing the script is to add these three lines on top of the script _ #singleinstance force param = %1% If (param = "exit") ExitApp _ Then you can run it with the parameter "exit" and it will reload and close itself. – 576i Jun 10 '13 at 08:00
  • @MCL Yes I did it through sikuli but how about without using sikuli?? – Praveen kumar Jun 10 '13 at 09:08

1 Answers1

3

You could try running autohotkey.exe with the script name as a parameter.

Example: If my Autohotkey.exe is in "C:\Program Files (x86)\AutoHotkey" and the script to start is "c:\temp\1.ahk"

I would run "C:\Program Files (x86)\AutoHotkey\autohotkey.exe c:\temp\1.ahk"

576i
  • 7,579
  • 12
  • 55
  • 92