Macro Insert Text gibberish under Sonoma

I have a large number of similar macros that were working in macOS Ventura that are no longer working and exhibit strange results.

These macros are for and are used to choose the From address and Signature values for outgoing messages.

The Move and Click to an offset from the image of the From: menu popup works, but the Insert Text by typing selects the wrong value.

The subsequent Move and Click to an offset from the image of the Signature popup menu doesn't pop up the menu, and further types text into the selected field that isn't from the contents of the next Insert Text by typing action.

I've tried adding Set Simulate Normal Typing Delay before text entry, turning off Notify on Failure for the click and move, and Process Nothing for the Insert Text. No changes.

I am using images for the click and move, since mail windows aren't consistently positioned or sized, depending on displayed fields and adjustment to window sizes.

If I disable the Click and Move events, the text types into the selected field correctly.

These macros are all attempts to replace Mail Act-On and Signature Pro Apple Mail plugins, so if someone has done that with some macros, those details would be a great substitute for fixing these issues. :slight_smile:

I have no reports of anything like that, so my guess is other things are going on and causing confusing.

I have had mixed results controlling Mail’s compose window in Ventura, especially trying to reliably tab between fields.

My guess is all the relevant characters are being typed, they just aren't going to the right places because Mail is confused about what is selected.

So I would suggest things like:

  • Ensure the Notify & Abort is set on your click at found image actions.
  • Ensure the Restore Location is turned off on your click actions (so you can see where the click actually happens).
  • Add large pauses between each action so you can see the specific behaviour of the individual actions. Or use the Macro Debugger, though that can result in changed behaviour because of your own actions.

Thank you for the reply. I've tried all of the things you've suggested with no success, or rather, inconsistent success and maddening results.

The main thing that confuses me is that I have simple Macros that were working in Monterey and Ventura that no longer work reliably as Keyboard Maestro macros or Apple Keyboard Shortcuts. It takes multiple hotkey presses to get them to activate. Showing the Move To menu, or triggering a message move via an AppleScript macro. Is this a common issue?

I spent some time sorting out the AppleScript for UI manipulation, and it's also quirky, but was able to get this working. For some reason, you have explicitly add the process and application to the AppleScript command, rather than relying on the parent tell statements.

Sharing this here for others who have similar issues. Subsequent AppleScript UI interactions seem to require a pause of a minimum of 0.2 seconds to take effect. If you are also changing the signature in the same macro, just replace "From:" with "Signature:" and put a 0.2 second Pause action between menu selection actions.

tell application "System Events" to tell application process "Mail"

click pop up button "From:" of window "New Message" of application process "Mail" of application "System Events"

click menu item "First Last -" of menu 1 of pop up button "From:" of window "New Message" of application process "Mail" of application "System Events"

end tell

The Engine.log file will indicate whether they are being triggered multiple times or not.

I can pretty much guarantee that if the macro is active (ie, enabled, and the parent group is enabled, and the parent group is active in the current context) then any hot key trigger will active and trigger the macro to run. Issues like taking multiple pressed to trigger are far more likely to be that the macro is not actually active to the the macro is triggering multiple times and not always doing what you expect it to do. The Engine.log file will tell you which of those possibilities to look at.

The Engine.log shows that the respective Macro is triggering with each key press. The menu is just not displaying reliably, or the selected messages aren't moving reliably, and the Engine.log displays no error for these occasions where the effect is not happening.

Is it really possible for my Mail Group and the macros it contains to be active intermittently in the context of viewing the message list in Apple Mail?

The AppleScript solution for the From: and Signature: menus required a bit of tweaking for context, but seems to be very reliable now, which is great.