Jump to content
Macro Express Forums

Need the Right Wait/delay command


Firedog

Recommended Posts

Hi,

 

 

I am sitting here pulling my hair out, making me self bold..

 

Is there any way to make a command for the following:

Wait for window Title Change.

 

 

 

The problem is i determin the window titles in my script, but depending on how slow the program is it can go very wrong.

then i have to make a Delay on the highest amoung time it can wait. This is not good if it needs to go fast.

 

So any way i can make it wait until the Window Title change to something else (this is not the same everytime it change, as it takes the title of the mail it opens)

 

THanks alot for any suggestions..

 

Regards

Firedog

Link to comment
Share on other sites

Is there any way to make a command for the following:

Wait for window Title Change.

This can be accomplish using existing macro commands. Try this:

Variable Set Integer %N1% to 0   // initialize counter

// Set both T1 and T2 to the window title with focus
Variable Set String %T1% from Window Title
Variable Modify String: Copy %T1% to %T2%

// Repeat until the current window title changes or until 10 seconds have elapsed
Repeat Until %T3% = "DONE"
 Wait Time Delay 0.5 Seconds  // Put Macro Express to sleep for 1/2 a second
 Variable Set String %T1% from Window Title

 Variable Modify Integer: Inc (%N1%)  // increment seconds counter
 If Variable %T1% <> variable %T2%
OR
 If Variable %N1% > 20
Variable Set String %T3% "DONE"  // set flag to exit the repeat loop
 End If

Repeat End

This code is provided as an example. I did not test it. If you need this in more than one place in your macros you could put it in a separate macro and use it via the Macro Run command.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...