• 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
Find mail by subject and get content to clipboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Find mail by subject and get content to clipboard


  • Subject: Find mail by subject and get content to clipboard
  • From: Elijah Samuels <email@hidden>
  • Date: Mon, 7 Jul 2008 14:12:30 -0700

Hi,
So just like the title says, I need get my script to find a message in Mail by the subject line and then pull the content from it and set it to the clipboard so that AS can parse thru the text.  I posted this on a forum, but I'm not getting any help.

I don't if this helps, but I'm thinking something like this:

Tell application "Mail"
if theMsg contains "this subject" with less than or equal to 7 days of current date then set msgContent to content
else display dialog "No such message exists"
end if
end tell

Right now, this script works, but I have to select the message and switch to mail before the script runs.  Eventually, this will go into AS studio so the whole thing can be triggered by a button in IB.  But thats for later.  

Open this Scriplet in your Editor:


delay 2

-- XXX This section tells mail to get data XXX --
tell application "Mail"
   set foo to a reference to item 1 of (get selection)
   tell foo
       set jazzSubject to subject
       set jazzDate to date sent
       set allJazzStats to content
   end tell
end tell

return jazzSubject & jazzDate & allJazzStats
I've looked around for a couple day now, and haven't gotten it to work so any input would be beyond appreciated.
Thanks!
Ely @ apple
 _______________________________________________
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

References: 
 >set understanding to (get explanation) (From: Luther Fuller <email@hidden>)
 >Re: set understanding to (get explanation) (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Simple text question
  • Next by Date: Re: Is there a way to check the Ctrl, Alt, Cmd, Shift state?
  • Previous by thread: Re: set understanding to (get explanation)
  • Next by thread: Re: set understanding to (get explanation)
  • Index(es):
    • Date
    • Thread