Page 1 of 1

Run autohotkey.ahk file from push2run

Posted: Fri Mar 30, 2018 3:51 am
by bigjuergo
hi,

how do i run a autohotkey.ahk file from push2run?

i want to say:
ok google, tell my computer to press e button
then push2run should run the script <pushebutton.ahk>

thank you for help!

Re: Run autohotkey.ahk file from push2run

Posted: Fri Mar 30, 2018 9:11 am
by RobLatour
The quick answer is that you just need to create an .ahk file to do what you want to do, and then set it up in Push2Run as follows:

In Push2Run card's open field, enter the full path and file name of your .ahk file, for example:
c:\myscripts\SendE.ahk

Also on the Push2Run card, enter a description and some suitable phases to listen for.

I have attached an example Push2Run card to this post (just download it and double click on it to open it up).

Having that said, if all you really want to do is send an 'e' the .ahk file only needs to contain one line, as follows:
send e

However, more likely you probably want to send your 'e' to a specific application, so the .ahk script needs to also ensure it is running and is the active windows before 'e' is sent.

Hope this helps,

Rob

Re: Run autohotkey.ahk file from push2run

Posted: Fri Mar 30, 2018 12:19 pm
by bigjuergo
thank you for the hint.

basically i want to voice control my cycle training game zwift.
the connection between goolge home and push2run works.
I have managed to open programms, but i do not have manged to send a key to a programm.

therefore i have to send the key "3" for chaning the view.

can you please help me how to wirte the *.ahk file that it send the number "3" to the programm called Zwift?

thank you for the very helpful program push2run!!! :) that makes really fun to use

Re: Run autohotkey.ahk file from push2run

Posted: Fri Mar 30, 2018 12:25 pm
by bigjuergo
ok it worked as you said the desired programm has to be activated in front.
would be nice to send it directly to a Programm.

:)

Re: Run autohotkey.ahk file from push2run

Posted: Fri Mar 30, 2018 1:47 pm
by RobLatour
I don't have much experience with autohotkey, perhaps you can post on their forum.

However, here is an example of how it can be done using a .vbs script

viewtopic.php?f=9&t=14

The example is for sending keys to the windows calculator. However with a bit of editing, I'm fairly sure you could get it to do what you want.