Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get message in compose window from Mail.app

I am trying to make a script that will get the contents of an email message that I'm composing in Mail, do something with the data, and then send the message. I know how to make and send a new message from scratch with AppleScript, but I can't find a way to get a message that I'm already writing. I don't care what language is used, and I would be open to trying a different email client. Thanks for your help!

like image 363
MWean Avatar asked Nov 14 '22 01:11

MWean


1 Answers

Mail has huge limitations with regards to Applescript and dealing with its content area is a major one. The best bet is to use GUI scripting to tab to the content area, type cmd-C, and then work off the data in the clipboard.

Sadly from what I can see Applescript has not been improved at all in Lion.

like image 142
Clark Avatar answered Dec 06 '22 07:12

Clark