rikw Posted May 22, 2007 Share Posted May 22, 2007 Hi I'm trying to get the text (from content) out of selected mail messages and paste that text into a textEdit document using applescript. My attempt gets stuck between the two apps I think? tell application "Mail" get selected set para1 to "content" end tell tell application "TextEdit" activate make new document open document window end tell My next plan was to set the new textEdit document text to para1, but this must transgress OO rules I haven't learned yet so does not compile / run. Any help appreciated to move this on a stage or two please/ regards and tia rik Link to comment Share on other sites More sharing options...
A Nonny Moose Posted September 27, 2007 Share Posted September 27, 2007 Without GUI scripting (which Apple destroyed with OS updates) this is rather hard with AppleScript. This might be easier with Automator, since there are scripts to grab the mail message, but it will paste the entire message instead of just a part. Vexing indeed. Link to comment Share on other sites More sharing options...
thePixeler Posted December 5, 2007 Share Posted December 5, 2007 Is this what you need it to do? tell application "Mail" set selectedMessages to selection if (count of selectedMessages) is equal to 0 then display alert "No Messages Selected" message "You must select a message first." else set theMessage to item 1 of selectedMessages set theContent to content of theMessage tell application "TextEdit" activate make new document tell the front document set paragraph 1 to theContent end tell end tell end if end tell Link to comment Share on other sites More sharing options...
Recommended Posts