Sean Deely Woods has developed a kiosk system. It is completely button free and automatic. A Tcl/Tk script on an OS X machine looks for the presence of an iPod. When one is detected, the Tcl script triggers several behaviors in iTunes via Applescript, and ejects the iPod when completed.
The program, as well as all of the supporting Applescript subroutines, are available for download at
http://www.etoyoc.com/programs/It may sound simple, but there are some technical hurdles to overcome.
- First, iTunes isn't scripted to Apple's own standards. Many alerts are modal dialog boxes, and thus stop the program cold. The preamble to every call to iTunes is slapping the "c" and "n" button to clear away any dialog boxes that prevent the program from responding.
- Next, iTunes has no way to actually report when a file transfer is completed. So our Tcl program keeps a timer, and watches for a value passed back through a file.
- Finally this program makes extensive use of the Tcl event loop to "throw" behaviors into Applescript and then monitor the result. This keeps the program from getting stuck at one point and never moving on.