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.