hk_at

Wait for Button in other application

10 posts in this topic

Hi,

i was googeling around but couldnt find a good answer, but i gess mustbe simple :-)

i want to read some value from a third party applikation after is certain button was pressed, something like a waitforButton()

i didnt find anything proper in the documentation, maybe someone can give me a hint

WinWaitActive("xyz")
; waitforbutton("xyz","", "[CLASS:ThunderRT6CommandButton; INSTANCE:181]")
$cname = ControlGetText("xyz", "", "[CLASS:ThunderRT6TextBox; INSTANCE:29]")
MsgBox(0, "", $cname)

br

 

K

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!
How does the other application change when the button has been pressed? I assume you want to read the result that gets displayed after the action started by the button has ended.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

hi

exactly i want to read the value from the textbox and store it in a postgresql-db

Share this post


Link to post
Share on other sites

What is the value of @error after ControlGetText?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You can solve it like this:

WinWaitActive("xyz")
$cname= waitforText("xyz","", "[CLASS:ThunderRT6TextBox; INSTANCE:29]")
MsgBox(0, "", $cname)

Func waitforText($sTitle,$sText,$sCtrlID, $iTimeOut=60)
    if $iTimeOut<1 Then $iTimeOut=60
    $iTimeOut =* 1000
    Local $hStart=TimerInit(), $iEnd
    Local $Text = ControlGetText($sTitle,$sText,$sCtrlID), $NewText
    Do
        Sleep(250)
        $NewText= ControlGetText($sTitle,$sText,$sCtrlID)
        $iEnd=TimerDiff($hStart)
    Until $NewText<>$Text or $iEnd>$iTimeOut
    if $iEnd>$iTimeOut Then SetError(1)
    Return $NewText
EndFunc

 

Edited by AutoBert

Share this post


Link to post
Share on other sites

Seems this type of controls is hard/impossible to automate:

Maybe you need to use a copy & paste approach using Send commands.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@error is 0

refering to the idea of autobert, thx a lot but that would liit me to one field, unless i cascade the waitFunctions, isnt?

Share this post


Link to post
Share on other sites

I hope i understood your last post correct. Once the text has changed (as result of ButtonClick) you can read all controls text you need until a user action (ButtonClick etc.)  is needed.

Share this post


Link to post
Share on other sites

I hope i understood your last post correct. Once the text has changed (as result of ButtonClick) you can read all controls text you need until a user action (ButtonClick etc.)  is needed.

Share this post


Link to post
Share on other sites

I hope i understood your last post correct. Once the text has changed (as result of ButtonClick) you can read all controls text you need until a user action (ButtonClick etc.)  is needed.

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