The advantage to having Mail launch early in the day and quit later at night is to reduce spam email on my iPhone or iPad. My Mac runs SpamSieve which does an excellent job of trashing spam, and on IMAP email accounts (Gmail, iCloud, Yahoo! and most others), preventing it from showing up on my iPhone or iPad. The problem was scheduling email to startup and shut down on a schedule.
The App To Open Apps
One of the Mac apps that does the launching deed on a schedule is called LaunchOnTime. The name implies that it launches apps according to a schedule, and, well, that’s exactly what it does.
Use LaunchOnTime to setup a schedule for specific apps on your Mac to run according to a schedule.
It all works with Mac simplicity. Drag and drop. Drag the app you want to launch to LaunchOnTime, then set the launch time and date.
LaunchOnTime also counts down until the app is scheduled to launch. It launches files (which open assign apps), specific applications on your Mac, or even powerful AppleScripts which can perform certain functions.
Once you’ve setup an app to launch, and scheduled the date and time, simply click the Start button and it all just works. Other preferences include options to repeat app launches.
Click on the image above for a larger view.
LaunchOnTime works well enough, but what about when you want to quit an application at a specific time. LaunchOnTime does not do that directly, but it will launch an AppleScript that will. AppleScript is built in to OS X and comes with an editor in Applications > Utilities > Script Editor. Open the editor and create a new script and paste this into the blank script.
tell application “Mail”
Save the AppleScript to a safe location on your Mac and then have LaunchOnTime launch the AppleScript at a scheduled time. That will quit the app (in my case, Mail). You can do almost the same thing in Calendar by creating an AppleScript to launch Mail according to a schedule.
Setup a Calendar event to the date and time you want an app to launch, and use the Alarm to run an AppleScript which launches the app you want.
tell application “Mail”
Using Calendar to run an application at a specific time is a bit more complex than using LaunchOnTime, and if you’re sharing Calendar between Macs might that mightcause an issue, too, but both methods work very well on a single Mac.