Re: Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)...
Re: Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)...
- Subject: Re: Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)...
- From: Matthew Smith <email@hidden>
- Date: Sat, 21 Jun 2003 14:44:46 +1000
on 21/06/2003 08:55, Dave Stewart at email@hidden wrote:
>
tell application "Mail"
>
quit
>
end tell
>
>
delay 10
>
>
tell application "Mail"
>
activate
>
check for new mail
>
end tell
>
>
What's throwing me isn't the fact this doesn't work (although that fact
>
probably should), but the fact that each half by itself does!
Instead of just delaying it, why not check to see that Mail is not running
before telling it to launch.
tell application "System Events"
if exists application process "Mail" then
tell application "Mail" to quit
end if
repeat
delay 3
if not (exists application process "Mail") then exit repeat
end repeat
end tell
tell application "Mail"
activate
check for new mail
end tell
--
Matthew Smith
_______________________________________________
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.