Jump to content
Macro Express Forums

Waiting For A Control To Lose Focus?


Recommended Posts

I am a newbie and trying to automate some in Adobe Audition, a program for working with audiofiles. When I apply a filter to a soundfile, a progress-control pops up.


What I want to do, is continue the macro, only after the progress-control has closed. So after the filter has been applied, the macro may continue.


I have tried this with a delay, but depending on what else is done on my PC, the process-time for a filter is variable.


I have captured the progress-control, which has a different title for each different filter that is applied, and put this in C1. But when I let the macro wait for C1 to lose focus nothing happens.


Can someone please tell me, what I am doing wrong?


What is the way to let the macro wait for ending a process, whose progress is being shown in a popup-dialog?


Thanks !

Link to comment
Share on other sites

The first thing I would try is the Wait Window Lose Focus command. However, this will only work if the progress indicator is a separate dialog.


You may be able to use the Repeat with Processes command. I would put it inside another repeat loop to continually check to see if the process is still running. This will not work if the progress indicator is not a separate process (or program).


If the process consists of writing or updating a file you could use the Wait for File Exist and/or the Wait for File Ready command.


If you are using a Window Control to determine whether the progress indicator is active make sure that your Get Control command references only the progress indicator and not the form that it appears on. (Not all components of a program are defined as controls. Macro Express has no control over this.)


Some programs create a component and hide but not destroy it when the process that created it is complete. In this case waiting for a control to lose focus will not work.


Other programs report that a control has focus when in fact the parent control has focus. If this is the case then if the form, dialog or window has focus the application will report to Macro Express that the Window Control has focus.


Another popular technique is to use the Get Pixel Color command to determine when the progress indicator shows that the task is complete. One example of how to use this technique is in the sample macro Wait Web Page: Netscape.


There may be other techniques that others can suggest.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

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

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.

  • Create New...