Re: Mail/Screensaver/Offline
Re: Mail/Screensaver/Offline
- Subject: Re: Mail/Screensaver/Offline
- From: Stan Cleveland <email@hidden>
- Date: Fri, 25 Sep 2009 16:53:28 -0700
- Thread-topic: Mail/Screensaver/Offline
On 9/14/09 6:51 PM, "Joel Esler" wrote:
> I often leave my Mail.app open on my computer all the time. Is there
> a way to possibly force Apple's Mail.app to go into "offline" mode, or
> even quit when the screensaver kicks in? That way I can check my
> email on my Phone and it's not being moved around on the client side
> by my Mail.app rules?
Joel, that's a great idea! Give the code below a try. You'd save it as a
stay-open application bundle and launch it whenever you want it to monitor
the screensaver. You could adjust the idle interval to a smaller value,
depending on your needs.
on run
idle
end run
on idle
tell application "System Events"
if exists (process "ScreenSaverEngine") then
my takeMailOffline()
end if
end tell
return 300 -- seconds = 5 minutes
end idle
on quit
continue quit
end quit
on takeMailOffline()
tell application "Mail"
set fetches automatically to false
end tell
quit -- there's no need to continue idle cycle
end takeMailOffline
The "Mail" portion of the code sets the "Check for new mail" setting to
"Manually". When you return, you can either reset it via the GUI or use AS
to change the setting back to true.
Sorry for the slow response, but I've been on vacation!
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden