• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Applescript and email
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript and email


  • Subject: Re: Applescript and email
  • From: Christian Boyce <email@hidden>
  • Date: Thu, 21 Oct 2010 08:58:28 -0700

get the new (or unread)messages in my email
save them as text files on my desktop (From, Subject and Body)
(title could be a timestamp)
then delete the messages from my inbox (or mark them as read)
Virgil, if you want the script to work automatically from now on make a Mail Rule that triggers a script. 

Something like this:

using terms from application "Mail"
on perform mail action with messages the_messages for rule theRule
repeat with the_message in the_messages
tell application "Mail"
if read status of the_message is false then
set the_content to content of the_message
--more stuff here
end if
end tell
end repeat
end perform mail action with messages
end using terms from


The rule can also set the status to "read" for you (or delete the messages if you'd rather). 

If you just want to select a bunch of messages and then run a script here's a start for that. 

tell application "Mail"
--select a bunch of messages first
set the_messages to the selection
repeat with a_message in the_messages
if read status of a_message is false then
set the_content to content of the_message
-- do your stuff
end if
end repeat
end tell

Get it?
--
Christian Boyce
Christian Boyce and Associates, Mac, iPhone, and iPad Consultants
310-452-3720

Read the Boyce Blog: http://christianboyce.blogspot.com
Follow us on Twitter! http://twitter.com/christianboyce
Be a fan on Facebook! http://tinyurl.com/cboyce-and-associates-facebook

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Delivery Status Notification (Delay)
  • Next by Date: Re: Changing "open with" (Mac Finder) for certain files
  • Previous by thread: Applescript and email
  • Next by thread: image event help
  • Index(es):
    • Date
    • Thread