How to create a shortcut for a command represented only by an icon (in MAC's Preview), but is not accessible in the menu itself

Hello,

I want to create a macro keyboard shortcut which would allow me to share by email the pdf currently open in the front window in Preview.

The problem is that Share-Mail does not appear in any menu or sub-menu.

My problem is that I can only trigger the Share → Mail command by clicking on the share icon, and then Mail.

I am trying to emulate the Share (icon) - Mail command.

thanks very much !

Since the Share icon is always in the same place, you can simply click relative to the front window.

  • Click 160,35 relative to the top left corner of the front window.
  • Pause
  • Insert Text by Typing “Mail%Return%”
1 Like

Thank you Peter.
I play around with windows a lot, going from full to half screen.
I imagine that it would be a problem.
thanks very much

It should be possible to use an AppleScript with UI scripting to do this.
I've played around with it for a bit, but can't quite make it work.

Hopefully, @ccstone will come along and help us out.
He's the guru of AppleScript and UI scripting.

1 Like