How does one go about scheduling "settings" to change on applications given certain criteria? For e.g., I am using Adium, and between the hours of 8am and 5pm, I would like that status to set to "Available", and outside of these hours go "Invisible" or "Away".
The easiest way to do this is via Applescript. The commands you need are both single line. To make Adium go online the Applescript code is:
To make it go invisible, the Applescript code is:
Pretty simple. You can also tell Adium to
That was the easy part. The next question is how do you trigger the right script at the right time? You essentially need to create the following two scheduled tasks:
"run adium_invisible.scpt at 5pm everyday"
"run adium_online.scpt at 8am everyday"
The default way to do this, built into OS X, is to use the UNIX 'cron' daemon. It's documentation can be found here. If you find the cron interface intimidating, there is a GUI app you can use to set tasks up, called Cronnix.
You'll still need to understand the timing syntax that crontab files use though. Wikipedia can get you up speed on that. Inside your user crontab you want to create two scheduled tasks. They should look like this:
If editing the crontab file by hand, and not using Cronnix, don't copy and paste these verbatim, as tabs are required between the hours, minutes, days etc., not spaces as I have here.
Also, you could create cron tasks that use osascript and pass the Applescript directly like this:
However, storing the Applescript commands in a separate file gives you flexibility in the likely event that you need to change what commands get run later on. You can add to or remove from the .scpt files without needing to interfere with the crontab file.