Can this applescript be converted to use the iTunes Library framework instead of using the standard iTunes applescript .
My current script reads the users iTunes library and creates a file consisting of TrackName, TrackLocation and PersistentId, it works reliably but can be slow when user has a large iTunes library
tell application "iTunes"
with timeout of 2400 seconds
if (count of every file track of library playlist 1) is equal to 0 then
set thePath to (POSIX file "/tmp/songkong_itunes_model.new")
set fileref to open for access (thePath) with write permission
set eof fileref to 0
close access fileref
return
end if
tell every file track of library playlist 1
script performancekludge
property tracknames : its name
property locs : its location
property persistids : its persistent ID
end script
end tell
end timeout
end tell
set thePath to (POSIX file "/tmp/songkong_itunes_model.new")
set fileref to open for access (thePath) with write permission
set eof fileref to 0
tell performancekludge
repeat with i from 1 to length of its tracknames
try
set nextline to item i of its tracknames ¬
& "::" & POSIX path of item i of its locs ¬
& "::" & item i of its persistids
write nextline & linefeed as «class utf8» to fileref
end try
end repeat
end tell
close access fileref
The big different is this new framework doesn't require iTunes to actually be running and I expect it should be considerably faster. However the sparse instructions only discuss ObjectiveC I'm not clear how I would write a version in applescript (or even better in Java)