• 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: Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)... (From: Dave Stewart <email@hidden>)

  • Prev by Date: Re: GUI Scripting: accessing menus causes error
  • Next by Date: To OSAX or Not To OSAX?
  • Previous by thread: Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)...
  • Next by thread: Re: Oh-oh, another victim to scripting Mail (how do I restart Mail with AS?)...
  • Index(es):
    • Date
    • Thread