Pause-Until Action Failing with Button-Exists Option

I'm making a macro to import many files into an audio sequencer.

After importing the files the application sets off converting the files and lastly asks if I want them sequential (One track) or parallel (Different tracks).

This macro has worked before so I was surprised when checking today that KM does not proceed with Left Arrow and Return to click the button Different tracks.

You can see here that it recognizes the button.

Does anyone know why and how to fix this?

Hey Thomas,

Please – always tell us what software you're working with. It frequently makes all the difference.

It's also a good idea to tell us the versions of macOS and Keyboard Maestro. Here's a macro to make that easy:

Has your software changed versions, since you last used it? If so they may have broken something.

You can try this macro to see the UI-Elements of the dialog window.

Make sure the dialog window is frontmost and then run the macro.

For best results make sure BBEdit is installed on your system. (Not required – the macro will fall back to using TextEdit).

I recommend BBEdit because…
  • Although BBEdit is a commercial product, the trial version reverts to a
    still very powerful and free (BBEdit-Lite) version after 30 days.
  • It is very Mac-like.
  • It has excellent support for RegEx.
  • It is very AppleScriptable.
  • It has a two versatile command line tools.
  • It has been in continuous development for over 25 years.

I'm just guessing here, but it's possible the devs have fouled up that dialog and added a space or something to the button name.

-Chris

Hi Chris,

Sorry about that! Not my first time on a forum so I should have been more mindful.

Keyboard Maestro 10.2 on macOS 12.5.1
The application is Nuendo 12.0.40 that I can't remember have updated since it was working.

When running the 'Front Window Analysis Tool' nothing happens as long as the window to select tracks is open (and in front).

When running the tool after leaving the dialog (returning to Nuendo's main window) a blank Text Edit window called open_dX0igOu8.txt. BBEdit is also installed but does not open.

Thanks!
Thomas

Hmm, Nuendo is quite the beastie...

I'm not surprised System Events isn't seeing it. Many of those complex UI apps don't use standard macOS building blocks.

I missed that you demonstrated KM's Pause-Until action seeing the button...

Can you manually left and right arrow in that dialog?

That's not how those usually work – you usually have to tab or shift-tab – and the correct setting in the keyboard preferences must be active for dialog button/widget hopping to take place.

Try using a Press a Button action instead of keyboard actions.

Since KM can recognise the button -- can it click it for you, rather than you jumping through keystroke hoops?

image

This doesn't work either. It seems like KM can't recognize there is a window to begin with.

@ccstone I can manually left and right arrow and tab as well to get to 'Different tracks'.

When importing the audio files Nuendo prompts several progress windows called 'Converting file...' with a button named 'Abort'. I've tried having KM wait for those to not exist. I can't use time based conditions since it's different how many files I import and for how long each progress window stays up and how small a gap there is between progress windows.

Hmm... This kind of thing is always frustrating – especially when I cannot test.

  • You should see if a Keyboard Maestro action with right/left arrow will drive that dialog.
    • Disable all other actions or create a new macro to test with.

When troubleshooting this kind of issue look for the bottlenecks, break them down into the smallest possible bits, and test them in isolation.

Okay, we're making progress!
I ran the script as usual and again it stopped on the pop up window.

I ran the 'If Button Exists' macro and it displayed Exists!

Update: It was indeed user error. Previously I had hit Return to import files and now started hitting Enter instead (thinking they were interchangeable). KM was simply waiting for me to press Return before proceeding.

I changed the Pause Until condition to be 'any of the following are true' and added 'Enter'

2 Likes