Sign in to follow this  
Followers 0
Bobbins

Arduino Uploaded notification

7 posts in this topic

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!  :)  

Share this post


Link to post
Share on other sites



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

ldl0Iqz.png

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
Share on other sites

@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. 

1 person likes this

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0