Apple Mail Move Message To… Issues 20230301

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?

Thank you KM hive!

Hey Paul,

How can we possibly tell, since you didn't post an example macro for us.

We have no idea of what you're doing and can't troubleshoot the problem with a live macro.

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.

-Chris

2 Likes

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.

Thank you,

Paul
PPS Mail Group 20210214g Macros for KM Forum.kmmacros (22.0 KB)

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.

2 Likes

You could also use a IF menu-condition (menu path exists) to check first.

Thank you for the feedback.

I am not sure how to implement the "If…" action as far as looking to see if a mailbox open or closed.

I'll go with Zabobon's suggestion as it's easy enough to implement.

Best,

Paul


It would look something like this:

Download Macro(s): If Menu Path Exists – Select Menu Move Message(s) v1.00.kmmacros (8.7 KB)

Macro-Image

Keyboard Maestro Export

Macro-Notes
  • 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.

1 Like