Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Use cron for easier timing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use cron for easier timing
Authored by: tophu on Dec 15, '01 01:27:17PM
I've been doing this for some time, not really for an alarm to wake me, but as an easy way to get invasive reminders. (e.g. "Hey idiot, today's your Mom's birthday!")

I added a Reminders directory to my ~/Library folder (of course, you can put it anywhere you want, but I thought that was best.) and created reminders in the following form:

/usr/bin/osascript -e 'set volume 6'
/usr/bin/osascript -e 'say "your message here..."'
/usr/bin/osascript -e 'set volume 1'

The command osascript -e executes one line of AppleScript. See man osascript for complete details.

I saved these files with a .command file extension, so they automatically open in Terminal when double-clicked (mostly for testing).

Once I made all my reminders, it was simply a matter of putting them in my crontab. (The cron daemon should already be running on any normally configured OS X box.) Check out man 5 crontab for a complete explanation of the crontab format, then do a crontab -e to add the entries with your terminal default visual editor(or just go get Cronnix for an Aqua GUI on it).

Once set up, you get a great reminder system.

One no-brainer safety concern: Be sure to set the permissions on your reminders so that only you can edit them. Otherwise you are giving anyone who can an open door to execute abitrary code as you.

[ Reply to This | # ]