I have a simple Ruby script that uses the rb-appscript gem to control iTunes, and now that I've updated to iTunes 10.6.3, it appears to be broken.
Prior to 10.6.3, this piece of code would work as expected to get the currently selected track(s):
Appscript.app('iTunes').selection.get()
Now it produces the following error:
RuntimeError: Unknown property, element or command: 'selection'
Edit: Just confirmed that this is also broken in py-appscript, so it's not isolated to rb-appscript.
Which is weird, because the following piece of actual AppleScript still works:
tell application "iTunes" to get selection
Similar examples such as Appscript.app('Finder').desktop.files.get()
still work.
I couldn't find any information that would explain if or why this was changed or what I could do to update my script. I'm guessing it has something to do with Mountain Lion changes.
Yeah, they definitely broke it. You COULD use rb-appscript with the System Events application to conditionally check the children of various UI elements to see if the 'selected' attribute is true.... e.g.:
You could then pull out required information from the children of the selected row. This is would be a pretty annoying way to go about this, though.
Looks like iTunes 10.6.3 was release with the sandboxing that is coming with Mountain Lion. Here is an article talking about it (read the comments, too) http://www.leancrew.com/all-this/2012/06/the-first-nail-in-the-coffin-of-python-appscript/
Probably will start happening much more (if not with everything) as of Mountain Lion
I have provided a fix for this issue here:
https://github.com/mattneub/appscript/tree/master/rb-appscript