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

Re: adding a new rule to Mail


  • Subject: Re: adding a new rule to Mail
  • From: Oliver Moran <email@hidden>
  • Date: Sun, 22 Feb 2009 17:44:06 +0000

Hi all,

Just to feedback that I resolved this matter. The problem was syntax. The correct syntax is "run script" as follows:

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, run script:"/path/ to/apple/script.applescript" }
tell new_rule
make new rule condition with properties { ... }
end tell
end tell


Thanks none-the-less,
Oliver

On 21 Feb 2009, at 21:03, Oliver Moran wrote:

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
References: 
 >adding a new rule to Mail (From: Oliver Moran <email@hidden>)

  • Prev by Date: Archiving reminder script fails to work as expected.
  • Next by Date: Explaining syntax
  • Previous by thread: adding a new rule to Mail
  • Next by thread: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • Index(es):
    • Date
    • Thread