• 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: Getting script to run with apple mail rules.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting script to run with apple mail rules.


  • Subject: Re: Getting script to run with apple mail rules.
  • From: Bryan Vines <email@hidden>
  • Date: Fri, 8 Feb 2008 09:44:07 -0600

Brian,

I recently wrote a few scripts that are triggered by rules in Mail; they're nothing fancy; they verbally announce the arrival of certain message types using the "Say" command.

Your script would probably work just fine if reduced to this:

tell application "Finder"
     activate -- you want the Finder to come to the front to display the dialog rather than bounce in the dock
     display dialog "This computer will go to sleep in 1 minute." buttons {"Sleep", "Cancel"} default button 2 giving up after 60
     sleep
end tell

Save it as a script (not an application); save it someplace handy; then call it from a Mail rule. 
In Mail, edit your rule. In the "Perform the following actions" section, select "Run AppleScript".
Click the "Choose..." button, and in the resulting dialog, select the script you saved earlier.

That should do it.
-- 
Bryan Vines
email@hidden

On Feb 8, 2008, at 2:18 AM, email@hidden wrote:

From: Brian Taylor <email@hidden>
Subject: Getting script to run with apple mail rules.

Does anybody know the trick to get a script to run with mail.app  
rules.  Here is the script I wan to run when a message meets a  
certain filter.

using terms from application "Mail"
on perform mail action with messages theMessages for rule therule
tell application "Finder"

display dialog "This computer will go to sleep in 1 minute."  
buttons {"Sleep", "Cancel"} default button 2 giving up after 60

sleep

end tell
end perform mail action with messages
end using terms from

I've tried everything I can think of.  Seems like it should work.   
Can't get it to run.

Thanks.
Thank You,
Brian Taylor

 _______________________________________________
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

  • Prev by Date: Re: About login item deletion
  • Next by Date: Re: About login item deletion
  • Previous by thread: Re: Getting script to run with apple mail rules.
  • Next by thread: Looking for documentation to fill in the blanks...
  • Index(es):
    • Date
    • Thread