• 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
Mail Rules and 10.8.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mail Rules and 10.8.2


  • Subject: Mail Rules and 10.8.2
  • From: James Roberts <email@hidden>
  • Date: Thu, 20 Sep 2012 16:22:53 -0400

This script when run as a stand alone works perfectly. However when I run it as a mail rule it silently terminates and does nothing (the rest of the rule i.e., cloud background and flag work). This started with my move to 10.8. I’m also seeing a strange console error that may be related

sandboxd[37617]: ([36979]) Mail(36979) deny file-read-data /Library/Preferences/com.apple.mail.plist

Who can’t read the .plist, Mail? Anyway I figure it must be something to do with context but I don’t know enough about the sandboxing rules. I will keep searching and reading but was hoping someone could give me a nudge in the proper direction.

----------–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
(* create todo and flag msgs, used with Mail.app rules Update with calendar ID to support iCloud*)
on createTodo(todoMsg, msgUrl)
tell application "Calendar"
tell calendar id "8A85EB21-3F22-4D78-AE7B-FA20B07B0F7D"
set DueDate to (current date) + 5 * days
make new todo at end with properties {summary:todoMsg, due date:DueDate, priority:high priority, url:msgUrl}
end tell
end tell
end createTodo



-- using terms from application "Mail"
-- on perform mail action with messages messageList for rule theRule
tell application "Mail"
set messageList to selection --debug
repeat with a from 1 to count of the messageList
set msgId to (message id of item a of messageList)
set msgUrl to "message:<" & msgId & ">"
set fromMsg to (sender of item a of messageList as string)
if "<" is in fromMsg then
set x to offset of "<" in fromMsg
set fromName to rich text 1 thru (x - 1) of fromMsg
else
set fromName to fromMsg
end if


set subjMsg to (subject of item a of messageList as string)
set todoMsg to fromName & ":" & subjMsg
createTodo(todoMsg, msgUrl) of me


end repeat
(* tell application "Calendar"
delay 40
quit
end tell *)
end tell
-- end perform mail action with messages
-- end using terms from


James Roberts
email@hidden

"Nothing travels faster than the speed of light, with the possible exception of
bad news, which obeys its own set of laws" ~ Douglas Adams




 _______________________________________________
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 Rules and 10.8.2
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: Scripting Contacts in Mountain Lion
  • Next by Date: Re: Mail Rules and 10.8.2
  • Previous by thread: Re: ASE and 10.8.2
  • Next by thread: Re: Mail Rules and 10.8.2
  • Index(es):
    • Date
    • Thread