• 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: Mail Rule Scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail Rule Scripts


  • Subject: Re: Mail Rule Scripts
  • From: James Roberts <email@hidden>
  • Date: Sun, 23 Jan 2011 01:32:13 -0500


on perform_mail_action(CreateTodo)
tell application "Mail"
set theSelectedMessages to |SelectedMessages| of CreateTodo
set theRule to |Rule| of CreateTodo
repeat with a from 1 to count theSelectedMessages
set fromMsg to (sender of thisMessage as string)
set subjMsg to (subject of thisMessage as string)
set todoMsg to fromMsg & subjMsg
tell application "iCal"
tell calendar "Mail To Do"
set theDueDate to (current date)
make new todo at end with properties {summary:todoMsg, due date:theDueDate}
end tell
end tell
end repeat
end tell
end perform_mail_action

Make this the first line of the scrappy:

using terms from application "Mail"

Make this the last line:

end using terms from

Put the rest of the script, as you wrote it, between those two lines.

-- Michelle

Thanks Michelle,

Didn’t fix the problem though. 
Is there a problem with telling “iCal” to create the todo? Can I have Mail create it, there must be away of creating a todo in Mail from the script. "make new todo”. I will get playing again. Thanks for the help.

Jimmy
 _______________________________________________
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

  • Follow-Ups:
    • Re: Mail Rule Scripts
      • From: James Roberts <email@hidden>
References: 
 >Mail Rule Scripts (From: James Roberts <email@hidden>)

  • Prev by Date: Re: Editing Mail.app Messages
  • Next by Date: Re: Mail Rule Scripts
  • Previous by thread: Re: Mail Rule Scripts
  • Next by thread: Re: Mail Rule Scripts
  • Index(es):
    • Date
    • Thread