Your Mac comes with lots of ways to schedule tasks, but not all of it's ready to go out of the box. Beyond automated maintenance, OS X has a lot going for it, but you have to put in a bit of elbow grease to get everything working how you want it and on your schedule. In this tutorial we'll look at four ways you can automate and personalize your Mac's schedule in OS X.
We'll take a whack at a dead simple third party app, play around in System Preferences a bit, and try out a couple of scheduled workflows in Automator. Hit the jump to follow along.
1: Startup & Shutdown
This is one of the easiest automations on the Mac, and it’s native to OS X. Beyond convincing your roommate that your MacBook Pro was built on an ancient burial ground and ghosts are shutting it on and off, there are some pretty good reasons to have your Mac take care of these functions itself. Your Mac can boot up to perform routine maintenance while you’re asleep or at work, or shut itself off to save power when you’ve fallen asleep watching a movie. It can startup first thing in the morning to save you a step and a minute or two in the course of your day.
Your Mac can boot up to perform routine maintenance while you’re asleep or at work.
Here’s how you do it. Open System Preferences, either from Utilities in Applications or by clicking the Apple Menu. Choose Energy Saver and click Schedule...
Scheduling Shutdown and Startup in System Prefs
You can choose to startup/wake your Mac at a set time on a specific day of the week, just weekends, weekdays, or everyday. The second checkbox allows you to apply the same choices to when you want your Mac to sleep, restart, or shutdown, but you can only choose one of those three actions.
It’s important to note that if you have a MacBook Pro or MacBook Air, this tip will only work if your Mac is plugged into a power source. If you fall asleep with your Mac unplugged or your cat has a tendency to use your adapter plug for batting practice at night, your Mac won’t startup as advertised.
2: Regular Maintenance
Once your Mac is moving around at 2 AM while you’re sleeping, raiding the fridge or making calls on Skype, you can get it doing something really useful, such as the routine maintenance OS X is supposed to do in the middle of the night. This one is a particular sticking point for me, because while my MacBook Pro is “always on,” when I’m not using it, it’s closed and asleep for fear that my cats will walk across the keyboard when I’m not looking and accidentally-on-purpose order all of Etsy.
Cocktail is a great app for scheduling those maintenance tasks that will keep your Mac humming like a drowsy bee.
Cocktail is a great app for scheduling those maintenance tasks that will keep your Mac humming like a drowsy bee. Once downloaded and installed, you’ll have to enter an administrator’s password to get it open, because Cocktail just does that much next level stuff.
Click the Pilot tab all the way to the right, and choose Scheduler. Select which scripts you’d like Cocktail to run for you, Daily, Weekly, or Monthly. Those are just the built-in Mac OS X maintenance scripts, but Cocktail also gives you a few more options when setting up automation.
Cocktail can run lots of Mac maintenance tasks on a schedule.
Cocktail will clear selected caches, for either the user logged in or all users. Clicking Options gives you a lot more control over what happens when Cocktail takes a shiv to your various caches, and you can get really specific with your component, user, and Internet caches, letting Cocktail know exactly what’s good to keep and what gets the axe. You can also have Cocktail delete language files you’re not using, or tell Cocktail what to do with your log files during maintenance.
Cocktail will play a completion sound, nice if you have it set to run while you’re cooking or organizing your CDs, less so half an hour before your alarm goes off, though, so use with care. You can also set up Cocktail to shut down, log out, or put your Mac to sleep once it’s finished.
The important thing, though, is scheduling. You can set Cocktail to run your maintenance tasks every day or on a specific day of the week, at any time you want. When combined with the automated startup we discussed in number 1, you’ll have your Mac performing its own planned tuneup when you know you won’t be using it anyway.
3: Prime Your Mac So It’s Ready to Go when You Login
Most people have used Login Items in the past, even if they haven’t realized it. If you’ve installed an app that pops up a menubar item every time you start up, like Dropbox, Cloudapp, or Caffeine, you’re using Login Items. More than that, Login Items are apps that launch whenever you log in. If there are applications you always have running (like Mail or another email app) or apps you want to be the first thing you see when you look at your Mac in the morning (like iCal or task management), Login Items will get these apps rolling automatically for you.
Login Items are apps that launch whenever you log in.
Depending on the applicationss involved, this could significantly slow your login, however, and the more apps you pile on, the more significant the drag. Handle with care, your mileage may vary, and similar cliches are appropriate here.
To access Login Items, get into System Preferences, click Users & Groups, and choose the Login Items pane. There you’ll see a list of every app that launches when you login.
Login Items lets you decide what OS X launches on login.
Adding an app is pretty simple. If you want Mail to automatically launch, click the plus (+) sign under the list of apps and navigate to your Applications folder. Choose Mail, and click Add. Once added, if you want to hide the app on login, select the checkbox next to the app in the Login Items list.
If, like me, you’ve added pretty much all of your apps to your Login Items and you realize it’s taking an unreasonably long time for everything to load when you start your Mac up, it’s easy enough to remove the apps from Login Items that seemed like a good idea at the time but are just slowing things down. Just select the app you want to get rid of in the list and click the minus (-) sign. Poof! Gone.
For some ideas on what works in Login Items, email, calendars, and frequently used programs that you’ll turn to immediately are instant winners. I have my email app, a couple of cloud storage apps, Twitter, and a menubar Facebook updater in my Login Items, because those are the apps I’m either going to check right away or will want access to the entire time I’m using my Mac.
4: Schedule Everything Else with Automator and iCal
You can set your Mac up to do just about anything at anytime using Automator and iCal. Automator allows you to automate tasks without knowing anything about programming or scripting. Instead, Automator allows you to set up tasks as a series of actions inside a graphical user interface.
Automator will take care of all of the things we couldn’t do in the earlier steps, like running a specific application at a set time, not just at login. To get started, locate and open Automator in your Applications folder. If you’re not prompted to start a new document, Click New in the File menu, and then select iCal Alarm for your document type. An iCal Alarm allows you to choose whatever Automator actions you need and then schedule them using iCal.
On the left is the list of all the preset actions, and you can choose just one or a combination of several. I’ll run through a couple to give you an idea of what Automator can do with only minimal effort on your part.
First, we’ll set up an iTunes playlist as an alarm, not just an iCal event alarm, but something to wake you up in the morning or to remind you it’s time to exercise. In Automator, find the “Find iTunes Items” action, and drag it to the workflow area on the right. Now you’ll fiddle with some options. The default is to “find tracks where,” but select the “tracks” dropdown and choose “playlists.” Next, in the search field, enter the name of your iTunes playlist. You can run your workflow at this point using the buttons in the top right, but it won’t do much of anything except let you know that your Boyz II Men playlist was found.
Creating an iTunes playlist alarm workflow in Automator
Now that Automator can find Motown Philly, it has be able to play it somehow. Locate the “Play iTunes Playlist” action, and drag it to the workflow, beneath the Find action. Now you can run your workflow. iTunes will launch, and your general vicinity will be filled with lush hip-hop doo-wop. This is only half the Automator/iCal love story, but I’m going to pause to talk about how to automate more applications before we move on to scheduling.
If you want an application to open at a specific time, that’s even easier. Find “Launch Application” in the actions list, and drag it to the workflow. You can have as many instances of the “Launch Application" action as you’d like, but remember they’ll run in order.
In the Application drop-down, just choose which application you want to launch. You can schedule all the apps you use to work to pop up at 8:55 AM, so they’re ready for you when you sit down with your cup of Joe, or set your media center apps so they're waiting for you at 7:25 PM.
Scheduling an Automator iCal alarm workflow
Now that we’ve talked about a couple of the ways to set up workflows, you’re ready to schedule. You’ll save your workflow iCal Alarm, causing iCal to launch, and your workflow will appear as an event. Now all you have to do is edit it like any other iCal event. Change the time you’d like it to occur and the date, whether you’d like it to repeat--you probably will after all this trouble--and how often you’d like the alarm to go off.
These are only a few examples of what you can do with these features. Each of the scheduling tools discussed above can be tailored to whatever you need from your Mac on a given day and is capable of so much more than just automated startup, shutdown, and app launching. Automator's workflows in particluar are really endlessly customizable and, combined with the other scheduling tools in this tutorial, should keep you automating for days.