-
Dec '106
Updating EyeTunes
EyeTunes is an awesome open source framework for controlling iTunes from a Cocoa application. It’s only downside is it hasn’t been updated since 2008, but it’s easy to update and this article will go over the steps to do so.
Check Out From Source
The first step is to checkout EyeTunes from source, there is a download available but it’s even more out of date. The unreleased source is a much better starting point.
Google code says the EyeTunes trunk is here: http://eyetunes.googlecode.com/svn/trunk/ but it’s really here: http://eyetunes.googlecode.com/svn/EyeTunes/trunk/
However we recommend checking out our repository which has several updates and support for iTunes 10: https://github.com/InScopeApps/EyeTunes
Apple Event Codes
EyeTunes talks to iTunes with Apple Events, each event has a specific code. For example the code to test if a track is a movie is kVdM. More codes are added as more functionality is added to iTunes. These codes can also change, for example in iTunes 10 the code for unknown kind is kNon, however in previous versions the code was specific to the type, unknown video was kVdN.
To update EyeTunes we need to findout what these codes are. The instructions to do that are located here: http://code.google.com/p/eyetunes/wiki/ImplementationDetails.
Aete2sdef
In short iTunes is a carbon application so we need to translate it’s AppleScriptability information with an application called Aete2sdef. I had some trouble getting this app working because it’s distributed in an ancient compression format(.sit) and the executable bit was not set on the executable inside the app bundle. There is a working version of this application in our github repository for ease of use.
Extract /Applications/iTunes.app/Contents/Resources/iTunes.rsrc to a temp location like the desktop and run it through Aete2sdef to get the xml file of event keys. The resulting file should be something like iTunes_aete0.sdef.
This file isn’t actually used in the EyeTunes project, it just informs you about what event keys are available.
iTunes.h
Another file that is useful to generate is the iTunes header file which can be generated with this command line call from the ScriptingBridge docs:
sdef /Applications/iTunes.app | sdp -fh --basename iTunes
With these two files you should have a good idea of what iTunes commands are available.
Diff
Then you can use an application like FileMerge or Kaleidoscope to compare the newly generated files with the files for the previous version to see if there is any changes or added functionality.

