AppleScript to autoquit Entourage

F

Fletch

Hi!

I created an AppleScript to quit Entourage every day (so that it's not
downloading my pop mail while I'm at work).

This script is called from Entourage on a Schedule (which works just
fine) and the script itself worked great under Entourage X.

Now that I'm using Entourage 2004, however, I get about a 30% success
rate - but 70% of the time, the application hangs and I have to force
quit.

Here's the script:

tell application "Microsoft Entourage"
activate
quit
end tell

Any one out there have any thoughts on what I'm doing incorrectly? If I
remove the "activate" line, it also works... but I don't know if that's
the problem.

Thoughts?

Thank you!

~Jeff
 
A

Allen Watson

Could be some kind of timing conflict. After all, the script runs within
Entourage, and you are quitting the script's context, a bit like sawing off
the tree limb you are sitting on.

I'd do this (if I were to want to) with a cron job instead; use Cronnix to
set it up, and use the "osascript" command to run your script that quits
Entourage.

A kinder, gentler method might be a script that toggles "Work Offline"
instead of quitting the application. That should run from within Entourage
without any difficulty. When off line, Entourage won't check mail. Running
the script a second time will put Entourage back online.

tell application "Microsoft Entourage"
activate
end tell
tell application "System Events"
tell application process "Microsoft Entourage"
click menu item "Work Offline" of menu "Entourage" of menu bar item
"Entourage" of menu bar 1
end tell
end tell
 
F

Fletch

Thanks... I think Cronix is the way to go.

~J

Allen Watson said:
Could be some kind of timing conflict. After all, the script runs within
Entourage, and you are quitting the script's context, a bit like sawing off
the tree limb you are sitting on.

I'd do this (if I were to want to) with a cron job instead; use Cronnix to
set it up, and use the "osascript" command to run your script that quits
Entourage.

A kinder, gentler method might be a script that toggles "Work Offline"
instead of quitting the application. That should run from within Entourage
without any difficulty. When off line, Entourage won't check mail. Running
the script a second time will put Entourage back online.

tell application "Microsoft Entourage"
activate
end tell
tell application "System Events"
tell application process "Microsoft Entourage"
click menu item "Work Offline" of menu "Entourage" of menu bar item
"Entourage" of menu bar 1
end tell
end tell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top