Working macro now fails: Examine video clip with speedup Macro (v10.1.1)

Working macro now fails: Examine video clip with speedup Macro (v10.1.1)

I am configuring a new MBP, which I have updated to Monterey 12.5.
I installed Keyboard Maestro 10.1.1 from the KM site and loaded my license and my existing macros, most of which have been part of my workflow for many months. Some macros did not work at first, and I tried the excellent "Interactive Help" tool (under Help). It suggested some things that could be amiss, such as the bug in macOS translocation.
I followed the instructions to fix the translocation issue, and that helped.
Then the macOS permissions bug. I tried to fix that one, too. Many of my macros now work properly.

This macro to play a video file still does not work. The failure message is shown in the screenshot. I have tried restarting KM and the KM engine. I have tried rebooting.


Screen Shot 2022-07-29 at 11.32.19 PM

Error Message:
"The document "aaaa.mov" could not be opened.The file isn't compatible with Quicktime Player."
However, opening the file with cmd-O opens the file just fine. The KM macro I use to close the video file closes it just fine after it is opened using cmd-O.

Does anyone have ideas about other things to try?

Are you sure it is opening with the same application?

My guess would be one is opening with a version of Quicktime Player and failing, and the other is opening with a different version of Quicktime Player or different application.

That might be it! I’ll investigate.
I’ve loaded only a few third-party apps (such as Keyboard Maestro) so I didn’t think about any issue with macos apps. When I do a Spotlight search for QuickTime Player.app, the first hit is in “iCloud Library”.
What the…? Researching further.

Well, that wasn't it. When I limited Spotlight's wild searching to look only on my computer, it found the normal Apple app.

Upon further investigation, the macro seemed to work properly when QuickTime was already active. So I added the action to Activate QuickTime at the front of the macro.
Now it works! :grinning:

So I guess Monterey changed from how Catalina (and prior) would implicitly activate QuickTime in the macro. :man_shrugging:t4: It works with the minor modification of explicitly activating QuickTime Player.

(I would paste the macro in here for closure, but when I use the share button, it wants to start a new topic in the forum.)

I would never have gotten this far without the Interactive Help tool. Thank you!

1 Like

For future reference, if you haven't started a message, just let it make a new topic, then copy the parts you want to keep containing your macro/image, and then come back to this topic, new message, and then paste in the image/macro stuff.

If you have started, you need to copy your existing text, then cancel the reply, do the process above, and use the clipboard history to paste both your old message and the image/macro stuff.

It's a little tedious, but pretty straight forward.

Thank you, Peter!
(I was a bit sleepy or I would have tried to post a screenshot.) I'll do as you suggest next time.

My macro (as I changed it) is still not reliable. Sometimes it works, but sometimes not.

Monterey does something to purge QuickTime Player from memory as soon as the macro switches to the Finder. QuickTime disappears from the launcher (and Activity Monitor) almost immediately. Maybe part of the aggressive memory management on Monterey? Anyway it doesn't do what it did in Catalina or prior.

I'll look into AppleScript automation and repost when I have a more solid solution.

OK here is a version that seems reliable...
Examine video clip with speedup Macro (v10.1.1)

Instead of using the Action, Play Current Movie (which seems to no longer work consistently because QuickTime Player may have been purged from memory), just open the file with cmd-O. The file type for video clips has a default of QuickTime Player and it just works!

I have other macros that either delete the file or skip the file. Selecting the next file in Finder keeps me moving through the file listing of video clips.

My Monterey machine is out on loan but, IIRC, Preview does the same now -- quitting when no documents are open. Either leave something permanently open or add a "delay until QT is activated" step.

I keep meaning to find out if there's an OS setting somewhere to stop this (IMO annoying) behaviour -- if you find something, please let me know!

Yes, it seems to be a change with Monterey and/or M1 processors. And I'm old; I don't like changes. :confused: I expected the upgrade to a new Mac to have some challenges, but there has been more of a cognitive load than I anticipated. Apps and the OS have a different concept of operation. Maybe I should have upgraded sooner to make the transition less abrupt.

I added a 0.2 second (200 msec) delay before having Keyboard Maestro issue the next keystroke. That seems to work reliably. :grinning:

Examine video clip with speedup Macro (v10.1.1)

Examine video clip with speedup.kmmacros (6.3 KB)

In my testing (on Monterey 12.5 on M1 Mac) your very first Macro does work. The reason it fails to play the movie if QuickTime is not already open is that the System needs to catch up with the two Keyboard Maestro Actions - one to open QuickTime and the second to press "play". The solution that works consistently for me is to add in a conditional pause between the two Actions to make sure QuickTime is fully open and ready to play before Keyboard Maestro sends the "play" command.

Looking for a menu option that only becomes active when an App is ready to do something is a good way to add such pauses. In this case I used the menu item "Normal" (as in View>Playback Speed>Normal) as this menu item only becomes enabled when QuickTime has an open movie and is ready to play it.

1 Like

That sounds like a robust solution. Timed pauses as I used may be affected by other processing.

Thank you!

The thing I noticed was that in your original Macro you had no pause of any kind between the Open Finder Selection Action and the Play Current Movie Action. That is why it was only working if QuickTime was already running.

As I recall (my late-night recollection is hazy), QuickTime would sometimes NOT continue to run, even when I had just used it to view the previous file in the folder.

In Catalina, QT would not close on its own. I could just step through the video clips, opening them in QT one after another.

Your solution looks good, thank you!

Well, I tried what you posted, where the macro pauses for an enabled QuickTime menu item with "Normal" and it fails. The macro results in the same error message as before. ("The document ... could not be opened...")
The QuickTime app (version 10.5) remains active, and the menu "View > Playback Speed > " has only a greyed-out "None".

Still a mystery!
I'll revert to the short timed delay, I guess.

Ah, one other thing to try, re the "The document ... could not be opened...") issue.

As you have copied the Macro from another machine it is just possible that Keyboard Maestro is getting confused as to where the default QuickTime App is on your new machine as the original Macro would have been set up on your old machine. I would make a brand new "Open Finder Selection..." Action and set this to QuickTime (all on your new machine). This is still a long shot, but just that you mentioned something about finding QuickTime in iCloud when you did a search and that the Macro was originally on another Mac... and the fact that ⌘O works without the error message.

1 Like

THAT'S IT! :smiley:
Of course the issue is essentially what Peter guessed above. Your idea cured it!

The macro now works as it did on the old machine. Even without the wait condition. However it seems more robust to me with your wait condition, so I put it in and it works as expected.

Examine video clip with speedup - wait for menu Macro (v10.1.1)

Examine video clip with speedup - wait for menu.kmmacros (5.5 KB)

Thank you, Zabobon!

1 Like