Bobbins Posted December 4, 2014 Share Posted December 4, 2014 I am trying to get autoit to notify me and give a popup message of some kind once arduino finishes compiling. I have seen that you can detect when windows are opened or closed so is there perhaps anyway that autoit can detect changes in programs like a change in text written in the program, or even better when upload state changes to finish. If there is anyway to approach this I would appreciate it. Thanks in advance! Link to comment Share on other sites More sharing options...
JohnOne Posted December 4, 2014 Share Posted December 4, 2014 You answered your questions. Look at WinGetText, an StringInStr. Those in a loop with a bit of logic should be all you need. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Bobbins Posted December 5, 2014 Author Share Posted December 5, 2014 You answered your questions. Look at WinGetText, an StringInStr. Those in a loop with a bit of logic should be all you need. I have made a code for getting the string but when it launches nothing occurs. Did i make a mistake somewhere? This is my code and the window I'm trying to get the string from #include <Constants.au3> WinWaitActive("[CLASS:SunAwtFrame]") Send("^u") Local $sText = WinGetText("[CLASS:SunAwtFrame]") Local $iEvaluate = StringInStr ($sText, "Done uploading.", 0) if $iEvaluate > 0 Then WinClose("[CLASS:SunAwtFrame]") Exit EndIf Link to comment Share on other sites More sharing options...
JohnOne Posted December 5, 2014 Share Posted December 5, 2014 I think after Send, you probably need to loop the remaining code. #include <Constants.au3> WinWaitActive("[CLASS:SunAwtFrame]") Send("^u") While 3 Local $sText = WinGetText("[CLASS:SunAwtFrame]") Local $iEvaluate = StringInStr ($sText, "Done uploading.", 0) if $iEvaluate > 0 Then WinClose("[CLASS:SunAwtFrame]") MsgBox(0,0,0); just as indicator Exit EndIf WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Bobbins Posted December 8, 2014 Author Share Posted December 8, 2014 I think after Send, you probably need to loop the remaining code. #include <Constants.au3> WinWaitActive("[CLASS:SunAwtFrame]") Send("^u") While 3 Local $sText = WinGetText("[CLASS:SunAwtFrame]") Local $iEvaluate = StringInStr ($sText, "Done uploading.", 0) if $iEvaluate > 0 Then WinClose("[CLASS:SunAwtFrame]") MsgBox(0,0,0); just as indicator Exit EndIf WEnd I tried your code but to no avail, there isn't any popups showing up after the upload is done. Link to comment Share on other sites More sharing options...
JohnOne Posted December 8, 2014 Share Posted December 8, 2014 the code is not looking for a pop up AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Jfish Posted December 8, 2014 Share Posted December 8, 2014 @JohnOne - I think he means message box when he says popup. I think the issue may be the Arduino window. I have Arduino also and tried to read the text but Au3Info returns some kind of container "SunAwtFrame" - presumably Java that may not behave like a regular window. I could not read the text. As a first step to see if that is right, is the ever a situation in which you are able to read any text from that window before you start searching for the done message? If the answer is no then you may need to consider the >UI Automation Framework to read/find the appropriate text. JohnOne 1 Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now