Advertisement
Guest User

Combine selected Mail messages into a new email

a guest
Feb 1st, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "Mail"
  2.     set selectedMessages to selection
  3.     if (count of selectedMessages) is equal to 0 then
  4.         display alert "No Messages Selected" message "Select the messages you want to collect before running this script."
  5.     end if
  6.     set theText to ""
  7.     repeat with theMessage in selectedMessages
  8.         set theText to theText & (content of theMessage) as string
  9.     end repeat
  10.     set theSubject to "Subject goes here"
  11.     set theMessage to make new outgoing message with properties {subject:theSubject, content:theText, visible:true}
  12. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement