The world according to...
Nathan Oates
 
 
 

Tue, 27 Dec 2005

Automating MacTF-EPG
One of the things on my ToDo list was to hook some of the functions in MacTF-EPG up to AppleScript. This isn't the easiest thing when you do it the first time, but luckily I had worked out how for MacTF, so it was mainly a process of copying the relevant files and changing them to fit MacTF-EPG. This went fairly smoothly and before long the app could download data and upload it to the Toppy via AppleScript.

Where it got a bit harder was adding the automation so it was, you know, automatic... I've not really delved into cron and the like, and as MacTF-EPG is 10.4+ anyway, I thought I'd go for the launchd approach. For those who haven't heard of launchd, it's basically Apple's replacement for cron as well as a number of other Unix processes. It runs off XML files and is actually one of the first processes launched during startup, and it is responsible for starting most of the others.

So far so good. I played around with some of the XML plist files and slowly worked out some of the options. Lots of the links on Google about launchd refer to a number of (fairly large) bugs that existed in 10.4.0 through to 10.4.2. One of these was that repeated launches of a program based on a time/date was broken in that it would launch fine the first time, but never again (until a restart I guess). As this is fairly important (especially as I wanted something to fire daily), it was lucky that it was fixed in 10.4.3. However, it seems it isn't completely fixed, as now when you set a timer for daily use, it won't fire the first go, but then will the next time around (and hopefully thereafter). Which makes it a pain in the arse for testing, as I need to wait 24 hours to fix any errors I make...

The good news is that I think I have it working, so expect an update soon.


     
Comments

     
     

Your Comment

 
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Comment:
Save my Name and URL/Email for next time