Re: Oh-oh, another victim to scripting Mail
Re: Oh-oh, another victim to scripting Mail
- Subject: Re: Oh-oh, another victim to scripting Mail
- From: "Marc K. Myers" <email@hidden>
- Date: Sat, 21 Jun 2003 03:02:38 -0400
Date: Fri, 20 Jun 2003 15:55:12 -0700
Subject: Oh-oh, another victim to scripting Mail (how do I restart Mail
with AS?)...
From: Dave Stewart <email@hidden>
To: email@hidden
Hey folks!
For some reason, trying to script a very simple procedure in Mail has
reminded me of an old Chinese proverb -
"Confusion says what?"
Seriously, all I want to do is create a simple little script to restart
the Mail.app every day (why? Sometimes we do something to the mail
server here at work and Mail becomes very unhappy until it's restarted.
It just seemed like a nice little Friday project to script this so
people don't have to think about it). Unfortunately, likely due to my
total lack of experience with AS, I'm finding the simplest part
exceedingly difficult.
I'll deal with the neat things I want to add later (like checking if
Mail is running first, since telling Mail anything seems to fire it up
if it's not running; and of course the timing issue to make this happen
daily, and of course the stay open applet so it knows to do this daily
... at least I think that I assume that I want a stay open applet.
Don't ask too many questions, I'm not even sure what a stay-open applet
is, nor how to write one. But I digress, first things first ....)
I've started with these meager beginnings:
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!
This worked fine on my system:
tell application "Mail.app" to quit
delay 10
tell application "Mail.app" to activate
You don't need to tell Mail to check for new mail because it does that
automatically when you fire it up.
I'm running OS 10.2.6 and the second Mail beta.
Marc [06/21/03 3:01:25 AM]
_______________________________________________
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.