- tell application "iTunes"
repeat with f in (every file track of playlist "Foo")
set output to output & (get location of f) & "\n"
Maybe I'd be better off groveling through the "iTunes Music Library.xml" file...
It's pretty crazy that there seems to be no way to write to stdout besides appending to the magic "output" variable (which writes it all at once, at the end) or invoking a sub-shell to run "echo".
Do any of the Perl AppleScript bindings (there seem to be at least two of them?) just invoke "osascript", or do they do something less stupid and more efficient?