Skip to content

Instantly share code, notes, and snippets.

@du-song
Created July 25, 2011 01:42
Show Gist options
  • Save du-song/1103382 to your computer and use it in GitHub Desktop.
Save du-song/1103382 to your computer and use it in GitHub Desktop.
Restart Mail everyday
--- Restart Mail everyday!
--- 12 12 * * * osascript /scripts/RestartMail.applescript >/tmp/Mail.log 2>&1 &
on run
try
tell application "System Events" to set MailRun to (count of (every process whose name is "Mail")) > 0
if MailRun then
tell application "Mail" to quit
do shell script "sleep 5"
tell application "Mail" to open
end if
end try
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment