Reputation: 1503
I am trying to write a script in AHK to detect windows popup and capture the message.
For example: Program X will create a popup with a message. The AHK script should be able to detect the popup and get the message in it.
Is this possible?
I tried the example from http://www.autohotkey.com/board/topic/23221-run-command-prompt-commands-and-capture-output/ but it is too complicated.
I just need to capture the message of a popup using AHK script.
Upvotes: 2
Views: 4531
Reputation: 1503
Actually this can be done. The AHK code below will detect a Windows popup with the title "Test" and each time such a popup is detected it will write a message into a textfile.
Loop
{
Sleep 500
if (WinExist("Test"))
{
FileAppend, Another line. , C:\Users\user1\Desktop\testahk.txt
}
}
Take note: it is in a loop, so it will run continuously.
However I'm still trying to figure out how to grab the whatever message that will be shown inside the popup.
Still working on it. Anybody have an idea on that one?
Upvotes: 2