Skip to content

Communicate Back and Forth with Running AHK Script #355

Answered by spyoungtech
Lunatik6572 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the late response on this. Basically, this is what this library does. It invokes an AHK script as a subprocess and communicates back and forth with it via stdin/stdout. You can poke around the code in this repo and see how it's implemented.

When you use this library to add Python functions as hotkey callbacks -- When the AHK hotkey is invoked, it sends messages to Python via stdout, which Python in turn reads and the contents of the message indicates which Python callback function should be called. When you call a method like win_get Python sends a message containing the function parameters to the AHK subprocess via stdin; the AHK script reads stdin to know which function to cal…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Lunatik6572
Comment options

Answer selected by Lunatik6572
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants