10.5: A workaround for broken Mail rules |
|
|
Leopard has problems with rules in Mail.app that call AppleScripts that, in turn, generate a new Mail message. The scripts won't run from the rule, even though they work fine in Script Editor. Here's a workaround...
Have your rule in Mail run an AppleScript that calls a shell script, like this:
do shell script "/Users/murphymac/shell_script.sh"
Then have that shell script run the main AppleScript. Here's an example of what the shell script (shell_script.sh in this case) might look like:
osascript /Users/murphymac/MsgFetch.scpt
Design the main AppleScript so it targets certain messages, like a Mail rule would. Here's a simple example for selecting messages based on subject:
tell application "Mail"
activate
delay 1
tell (first message of inbox whose subject is "macosxhints") ¬
to if exists then
...
|