Mail rules with AppleScript timing out
Hi all,
Now that I switched to ML it seems my mail rules with AppleScripts time out most of the times. The console shows this error message:
Mail[1440]: Failed execution of AppleScript: /Users/Username/Library/Application Scripts/com.apple.mail/NuvieSnapshotMAIL.scpt
Error Domain=NSPOSIXErrorDomain Code=2 "The operation couldn’t be completed. /Users/Username/Library/Application Scripts/com.apple.mail/NuvieSnapshotMAIL.scpt: execution error: Mail got an error: AppleEvent timed out. (-1712)
˘ " UserInfo=0x7f9fb2d648f0 {NSURL=file://localhost/Users/Username/Library/Application%20Scripts/com.apple. mail/NuvieSnapshotMAIL.scpt, NSLocalizedFailureReason=/Users/Username/Library/Application Scripts/com.apple.mail/NuvieSnapshotMAIL.scpt: execution error: Mail got an error: AppleEvent timed out. (-1712)
˘ }
the Mail rules triggers on SVN commit messages. For example:
If *ALL* of the following conditions are met:
Message content contains nuvie/trunk +
Any Recipient contains nuvie-svn@lists.sourceforge.net
Perform the following actions:
Run AppleScript NuviesnapshotMAIL
If I run the Applescript manually it runs fine.
The script looks like this
tell application "Mail"
activate
set snapshotdialog to display dialog "New revision of Nuvie. Build snapshot?" buttons {"Cancel", "OK"} giving up after 180 with icon caution with title "Nuvie Snapshot"
if button returned of snapshotdialog = "OK" or gave up of snapshotdialog is true then
activate application "Terminal"
delay 2
tell application "System Events" to tell process "Terminal"
keystroke "t" using {command down}
end tell
tell application "Terminal"
repeat with win in windows
try
if get frontmost of win is true then
do script "cd ~/code/sh; . nuviesnapshot.sh" in (selected tab of win)
end if
end try
end repeat
end tell
end if
end tell
This worked fine in 10.6 and 10.7.
Anyone got an idea what is going wrong there or should I file a bug report with Apple?