It would be immensely valuable to me if I could invoke an AHK routine from another (DOS-based) macro rather than by the user hitting a key.
I don't want the DOS-based macro to do anything at a command prompt. When it does that, it's a little slow and my screen gets messed up when it's done.
I have SETTIMER running to "watch" the program running the macro, so can I activate AHK according to when a certain text string appears on that script's screen? For instance, I could have my macro print on its screen "xqqqx" (or any other unique string). Could that be used to active a whole AHK stanza?
I've thought of having the macro open a new window named xqqqx, and AHK could respond to that, but that's rather awkward. Is there some other way?
Thanks.
Triggering AHK other than by user keystroke
-
- Posts: 17
- Joined: 14 Feb 2016, 00:45
Re: Triggering AHK other than by user keystroke
Perhaps try imagesearch? Use a SetTimer to check each second (for example) if it can find "xqqqx" withing your DOS program window, and then trigger your AHK code?
-
- Posts: 17
- Joined: 14 Feb 2016, 00:45
Re: Triggering AHK other than by user keystroke
Image Search is a really interesting idea. I'll give it a try.
-
- Posts: 17
- Joined: 14 Feb 2016, 00:45
Re: Triggering AHK other than by user keystroke
Alas, taking a screenshot of the text proved too crude to match. I don't know how else to get an image file of the text that will be pixel for pixel identical, so I'm pursuing other approaches.
Re: Triggering AHK other than by user keystroke
1 - Perhaps don't use text but something easy as five pipes ||||| that can't be too hard to grab or even redraw manually
2 - How do you start the macro, is it a hotkey you press in your program? If so why not make a context sensitive hotkey in ahk which is the same but isn't blocked, that way when you press the hotkey the program still receives? (Look at the ~ "When the hotkey fires, its key's native function will not be blocked (hidden from the system)." https://autohotkey.com/docs/Hotkeys.htm
2 - How do you start the macro, is it a hotkey you press in your program? If so why not make a context sensitive hotkey in ahk which is the same but isn't blocked, that way when you press the hotkey the program still receives? (Look at the ~ "When the hotkey fires, its key's native function will not be blocked (hidden from the system)." https://autohotkey.com/docs/Hotkeys.htm
-
- Posts: 36
- Joined: 21 May 2016, 03:32
Re: Triggering AHK other than by user keystroke
Will "xqqqx" window be certain process/program? Cause you can look for certain program name of the window/process name currently running without need to ImageSearch for it.
Re: Triggering AHK other than by user keystroke
Is there some type of inter process communication which the DOS based macro can send and the AHK can receive?
Something like SendMessage? OnMessage?
Other ideas: Write to a file? Could the DOS based macro create an ini file which AHK could read?
Something like SendMessage? OnMessage?
Other ideas: Write to a file? Could the DOS based macro create an ini file which AHK could read?
Who is online
Users browsing this forum: No registered users and 135 guests