For reasons far beyond my brain power, my KM scripts for moving messages around in Mac Mail (Version 12.4) get screwy, depending on whether or not folders and sub-folders in the sidebar are open or closed.
Is there a workaround, or do I need to add a "contingency step" to my macros?
If you're trying to use a Select or Show a Menu Item action for this task, then you'll just have to cope with the fact that Apple is incredibly inept in the usability department and changing the sidebar actually changes the menu structure.
To get what you want consistently you'll have to resort to AppleScript.
Well, Chris, for someone who cannot possible tell, and has no idea what I'm doing with my Apple Mail macros, you managed to nail down the issue, thank you.
For your reference, I have attached some of the macros that sometimes work, depending on the sidebar/menu structure issue you mentioned.
I'll have to dig around the glorious KM hive to see if there are any AppleScripts that deal with the capricious Apple Mail menu structure.
I have a method of dealing with this that works consistently for me. Instead of a single Menu Action in the Macro, you have two menu Actions, each having the alternative menu path and both Actions are set to not Abort the Macro or Notify on failure (set using the top right corner gear menu in the Actions).
This does require the folder you are moving the messages to to have a unique name, not used by other folders.
Macros are always disabled when imported into the Keyboard Maestro Editor.
The user must ensure the macro is enabled.
The user must also ensure the macro's parent macro-group is enabled.
System Information
macOS 10.14.6
Keyboard Maestro v10.2
Personally I'm never going to fool with this mess as long as AppleScript is available...
tell application "Mail"
set destinationMailbox to mailbox "Correspondence/Business Correspondence" of account id "5B2A8A8A-0340-4D69-84C4-000000000000"
set selectedMessageList to selection
if selectedMessageList ≠ {} then
repeat with theMessage in selectedMessageList
move theMessage to destinationMailbox
end repeat
else
error "Zero messages were selected!"
end if
end tell
And for that matter I think it's worth paying for SmallCubed's MailSuite just for the Mail Act-On component – and this makes moving and copying things around waaay more convenient.
I use email so much that the cost was worth it to me.
I also have 75 AppleScripts for Mail and 36 Keyboard Maestro macros.