Issue with pausing

So I have a macro that's supposed to wait for the program to be done with what it's doing before activating the next command but the time it takes to complete varies. The problem is that I can't figure out how to get it to wait long enough without a prompt from the user. I want it to be automated. If the next process fires too soon the macro doesn't function properly.

I tried having it wait until the window says something different but it opens and closes multiple times in the process (based on a user defined variable) and I can't figure out how to tell KM to wait that many times for the window to appear/disappear.

Or maybe tell it unless it sees the window named "X" for a number of seconds, don't move to the next action.

Thoughts?

It would help if you could upload your current macro and provide more details about your workflow (for example, the program you're working in, and what exactly it's doing that you want the macro to wait for) but if you're already using a user-defined variable to open and close this window, you should be able to have that opening and closing all take place in its own loop action (again, I can't advise which one without more details or the current version of the macro), which would ensure everything you need to wait for is done before the macro proceeds.

I think I found a way to make it work. The "While" group is looking at the window name. If it sees "Writing" it waits 10 seconds and checks again. So far it's worked as expected. If somehow the loop ends EXACTLY the same time as the window closes (which takes a fraction of a second to close then open again) it will fail. So far so good...

Well... That failed. Let me upload it and you can see what possibilities I have. The problem is that I have files rendering and I want it to wait until that's done before moving on. It happens twice in the whole macro.--LIVE FIX MASTER 10.0 --.kmmacros (57.7 KB)

I got it! I have it in a loop with a pause while condition.

The user inputs the number of files at the start. I use that number + 1 to keep it in a loop as the windows come and go. When it finally sees that the window name has changed after the last loop it continues.

Screen Shot 2020-05-20 at 1.27.24 PM

1 Like