• 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
adding a new rule to Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adding a new rule to Mail


  • Subject: adding a new rule to Mail
  • From: Oliver Moran <email@hidden>
  • Date: Sat, 21 Feb 2009 21:03:07 +0000

Hi,

I have written a script for a rule in Mail. The purpose of the script is to scan in-coming mail and modify the mail subject as necessary.

This all works fine, but I would like to have an "install script" to add the rule to mail automatically. What I have is the following:

tell application "Mail"
set new_rule to make new rule at end of rules with properties { name:"New Rule", all conditions must be met:true, AppleScript:"/path/ to/apple/script.applescript" }
tell new_rule
make new rule condition with properties { ... }
end tell
end tell


This 'compiles' fine and executes perfectly except that it does not add a "Run AppleScript" section to the rule in Mail.

Is the syntax correct? Does "make new rule at end of rules with properties" need additional properties to add the AppleScript to the rule's actions? Or is this feature disabled to AppleScript (presumably for security reasons)? (The script does not return an "Access Denied" error as it does if I try to say "tell new_rule set hidden to true".)

Many thanks in advance for your help,
Oliver
_______________________________________________
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: adding a new rule to Mail
      • From: Oliver Moran <email@hidden>
  • Prev by Date: Re: including source code <Jim Brandt>
  • Next by Date: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • Previous by thread: Re: including source code <Jim Brandt>
  • Next by thread: Re: adding a new rule to Mail
  • Index(es):
    • Date
    • Thread