geekiest alarm clock ever.
Wouldn’t it be nice to wake up to something other than morning drive-time radio and/or the incredibly annoying BEEP BEEP BEEP of your $12 alarm clock? Wouldn’t it be nice to wake up to a different thing for each day of the week, and on weekends, maybe not be woken up at all? Your Mac can do all this for you, it just needs a little massaging to do so. Here’s how to set this up in a couple of easy steps, and you’ll learn some UNIX scripting and AppleScripting in the process.
- First, set up iTunes to have a folder called “Alarm Clock” and seven playlists inside, each named after a day of the week. It’s actually only for the sake of tidiness that the playlists are in a folder, and you can actually name the folder anything you like; the important thing here is to have a playlist for each day of the week you wish to be awakened.

Fill up the playlists with whatever you want to be awakened to; mp3s, streaming audio, whatever. Anything you place in the playlist for that day will be played. I suggest something light, but it’s your call, man.
- Start up “Script Editor” in the Applescript folder of your Applications folder and paste this in:
set day_of_week to do shell script "date +%A" as string
tell application "iTunes"
stop
try
play playlist day_of_week
on error
--do nothing
end try
end tell
What this does is get the day of the week via the UNIX “date” command, and set to a variable called “day_of_week”. Then it tells iTunes to play a playlist with that name. Save this script as an Application (and make sure “Run Only”, “Startup Screen”, and “Stay Open” options are all unchecked). Save it as “Alarm-Clock” and save it to your /Library/Scripts folder.
- Now we’re going to set up the scheduling. While you could use iCal to trigger the script every morning, that would clutter up your calendar, so we’re going to use cron scripting. Download a program called “Cronnix“. Cron scripting is an industrial-strength system used on UNIX servers to automate processes that have to happen on a set schedule. Cron scripts, however, are notoriously difficult to write, so we’re going to use Cronnix — a program that allows you to visually modify the user crontab — to help us out, and specifically, we’re going to use it to activate the AppleScript you just wrote.
- Open up Cronnix. Click “New”. Click the “Simple” tab. Drag the sliders next to “Minute” and “Hour” to specify the time you want to wake up. Click off the boxes next to “Day” and “Month” because you’ll want the alarm script to run every day, even if you don’t want to be waken up every day. In the “command” box, paste:
/usr/bin/open /Library/Scripts/Alarm-Clock.app
Click “Save”.
At this point, you’re all set; your computer will activate the script at the time you specified, it will look for a playlist named after the day of the week and play it. If it doesn’t find the playlist, or if there’s nothing in the playlist, it won’t do anything; so if you don’t have tracks in the “Saturday” or “Sunday” playlists — or if you don’t even have “Saturday” or “Sunday” playlists — you won’t hear anything at all. There are some caveats here; your computer has to be turned on, you have to be within earshot of it, and since the mechanism that triggers the alarm is in your “crontab”, you have to be logged in for this to work… so if that’s not the case for you and your mac, then this isn’t the solution for you.
- BONUS POINTS: Get an Airport Express and pipe iTunes’ output through your stereo. Wow, won’t your neighbors be
annoyedimpressed!
~jeff