Jump to content

Wait until button text = OK


Recommended Posts

What I am trying to do is automate the mp3 conversion process in exact audio copy but i need some help. this is what i have so far

;Load Audio Conveter

Run ("C:\Program Files\Exact Audio Copy\EAC.exe")

;Wait for the window "EAC" to exist and be active

Sleep (3000)

WinSetState ("Exact Audio Copy","", @SW_MAXIMIZE )

WinWaitActive("Exact Audio Copy")

WinSetState ("Exact Audio Copy","", @SW_MAXIMIZE )

;Select The Correct CD Drive

MouseClick ( "left" ,314,54)

MouseClick ( "left" ,314,96)

;Wait Until Disk is ready

Sleep(10000)

;Select MP3 Conversion

MouseClick ( "left" ,24,208)

;Choose Foler Location

MouseClick ( "left" ,323,83)

Send ("C:\Users\Media\Music\MP3's\Temp{Enter}")

Send ("{Enter}")

;Wait Until Conversion is Completed

;Close Dialogue Boxes

Send ("{Enter}")

Sleep(3000)

Send ("{Enter}")

;Close EAC

WinClose("Exact Audio Copy - Unknown Artist / Unknown Title")

I need help with the wait until the conversion is complete

there is a dialogue box which has the button with text "Cancel" until it is complete but changes to OK when done i'd like it to wait for this to finish before contiuing with the rest of the task. I have no idea where to start. I have the following from AutoIt window info

whilst Running

>>>> Window <<<<

Title: Extracting Audio Data

Class: #32770

Position: 6, 63

Size: 366, 497

Style: 0x94CA00C4

ExStyle: 0x00010101

Handle: 0x000E0758

>>>> Control <<<<

Class: Button

Instance: 3

ClassnameNN: Button3

Advanced (Class): [CLASS:Button; INSTANCE:3]

ID: 811

Text: Cancel

Position: 182, 434

Size: 113, 26

ControlClick Coords: 81, 21

Style: 0x50030001

ExStyle: 0x00000004

Handle: 0x000A0710

>>>> Mouse <<<<

Position: 272, 541

Cursor ID: 15

Color: 0xA9DBF6

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Total

Speed

Track

Speed

100.0 %

100.0 %

70.5 X

70.6 X

Time

Est. Remaining

Time

Est. Remaining

Status

0:00:06

0:00:00

0:00:06

0:00:00

Copy Track

1

Track Progress

Total Progress

Cancel

Filename :

Track01.wav

Skip Track

Error correction :

Power Down after extraction finished

7:18.98

>>>> Hidden Text <<<<

Once Completed

>>>> Window <<<<

Title: Extracting Audio Data

Class: #32770

Position: 6, 63

Size: 366, 497

Style: 0x94CA00C4

ExStyle: 0x00010101

Handle: 0x00140742

>>>> Control <<<<

Class: Button

Instance: 3

ClassnameNN: Button3

Advanced (Class): [CLASS:Button; INSTANCE:3]

ID: 811

Text: OK

Position: 182, 434

Size: 113, 26

ControlClick Coords: 70, 16

Style: 0x50030001

ExStyle: 0x00000004

Handle: 0x00240480

>>>> Mouse <<<<

Position: 261, 536

Cursor ID: 2

Color: 0xB5E2FA

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Total

Speed

Track

Speed

100.0 %

100.0 %

75.1 X

75.1 X

Time

Est. Remaining

Time

Est. Remaining

Status

0:00:05

0:00:00

0:00:05

0:00:00

Copy Track

1

Track Progress

Total Progress

OK

Filename :

Track01.wav

Skip Track

Error correction :

Power Down after extraction finished

7:18.98

>>>> Hidden Text <<<<

I can see the text that changes but how do i monitor it and continue once it states OK?

Link to comment
Share on other sites

Help File>>Functons>>Window Management>>Controls>>ControlGetText()

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

It looks like i still need more help, please.

Do

$var = ControlGetText("[CLASS:Button]", "", "811")

Sleep(1000)

Until $var = "OK"

MouseClick ( "left" ,245,530)

just seems to loop indefinatly, what am i doing wrong?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...