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

Re: Mail Rules and Scripts


  • Subject: Re: Mail Rules and Scripts
  • From: cricket <email@hidden>
  • Date: Fri, 7 Feb 2003 10:52:48 -0800

On Thursday, February 06, 2003, at 21:10PM, Rob Jorgensen wrote:

I'm not a user of Apple's Mail app so I'm not familiar with how to configure rules and scripts. Someone has asked for help so I come to you for answers. I tried a quick test and was unable to trigger a simple "display dialog" script with a rule. I couldn't find anything in Mail's help.

Does Mail require compiled scripts or applications? Do the scripts need to be stored in a specific location? Are there any limitations? Do the scripts need a file extension when saving them?

Thanks for any info that you might provide.

The need to be compiled scripts. The location doesn't matter, as long as you don't move the script after you have attached it to a Mail rule. They are currently stored as paths to the script, so moving it would cause the rule to silently fail. They don't need a special file extension.

It's not well documented right now, but we plan to update the Mail Help documentation in the next update and hopefully post a tech note. A simple script such as this would display a dialog:

on perform_mail_action(info)
display dialog "Hi!"
end perform_mail_action

To verify it works, create a rule, put it first in your rule list, make the condition 'every message', attach the applescript, select any message and choose 'Apply Rules To Selection' from the Message menu. One thing to keep in mind is that any rule that does a transfer ends further evaluation on a message, so that could be why the script isn't getting triggered.

A more interesting example is this:

on perform_mail_action(info)
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
set theRule to |Rule| of info
repeat with eachMessage in selectedMessages
set theSubject to subject of eachMessage
set theRuleName to name of theRule
set theText to "The rule named '" & theRuleName & "' matched this message:" & return & return & "Subject: " & theSubject
display dialog theText
end repeat
end tell
end perform_mail_action

Hope that helps,

- cricket

----->
Software Entomologist  Mail for Mac OS X
http://www.apple.com/macosx/jaguar/mail.html
---------->
A town, poised on a precipice, over a tinderbox, full of powderkegs.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Mail Rules and Scripts (From: Rob Jorgensen <email@hidden>)

  • Prev by Date: Re: HELP Remove Missing Tracks from iTunes Library
  • Next by Date: Re: iTunes playpause vs. mute
  • Previous by thread: Mail Rules and Scripts
  • Next by thread: iTunes playpause vs. mute -> was "Removing Missing Tracks"
  • Index(es):
    • Date
    • Thread