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


Click here to return to the 'Display iTunes cover art in iChat AV' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Display iTunes cover art in iChat AV
Authored by: eduo on Aug 29, '03 12:44:53PM

Why not think of Cron and use cron for this?

Cron can currently run AppleScript (as well as a plethora of others) scripts at intervals and has severla GUI interfaces that can be used to set things up in a "friendly" window.

What has cron missing from what you're proposing? (just a question, not a flame).

Conversely. Put a single script in cron that executes a specified applescript, and this secondary applescript has its own directories and way of controlling what scripts run when. So every minute or every 10 minutes the "main" applescript script runs and this one, in turn, runs whatever is appropiate according to its internal definitions

Eduo

---
Eduo



[ Reply to This | # ]
Display iTunes cover art in iChat AV
Authored by: dhawes on Aug 29, '03 07:21:42PM
You got to it first :)
I planned on posting a similar message.
To execute an AppleScript as a background timed event you can use cron. There is a command line tool on OS X called osascript that can be used to execute applescripts (man osascript). For a good Cron GUI I'd recommend Cronnix - http://www.versiontracker.com/dyn/moreinfo/macosx/9478

The command to execute would be osascript (path/to/applescript) and you can do as many as you want.
So if you open a terminal and type 'crontab -e' to edit your own crontab file you can enter something like:
*/5 * * * * /usr/bin/osascript /path/to/applescript1
*/10 * * * * /usr/bin/osascript /path/to/applescript2
*/15 * * * * /usr/bin/osascript /path/to/applescript3

Then cntrl-x and return to save your changes and you have a cron job configured that will execute three applescripts - applescript1 will be run every 5 minutes, applescript2 every 10 and applescript3 every 15.

BTW - mazatty - if you complete your scriptdaemon and it will be released as an open source freeware project let me know. I'd be happy to post it on cocoaobjects, perhaps you could supply a 'how to' to go along with it.

Hope that helps,
Daryl

---
-----
www.cocoaobjects.com

[ Reply to This | # ]