I'm trying to make a script that takes selected text in Mail.app, gets it into the script and does some processing to it.

I don't want to have a GUI script that emulates command-C to copy the text to the clipboard. I'd like to be able to set a variable in my script directly to whatever text is selected. This text might be in a 'compose' window, or it might be non-editable text in a 'read message' window.

Right now I have this Mail script set up so it asks for input. And I copy the selected text, and paste it into the dialog box. But it would be very nice to skip that step and have the script get the selection directly.

  • 2
    Have you tried using an Automator service with setting... Service receives selected text in Mail and adding a Run AppleScript action to process the selected text? – user3439894 Dec 29 '18 at 5:44

You must log in to answer this question.

Browse other questions tagged .