I am working on an Applescript that converts aac files to mp3 to help prepare mp3 discs. (I got a sweet mp3 car stereo for Christmas!) My script works perfectly when run from the Script Editor, but when I plop the script into the iTunes Scripts folder and try to run it from iTunes, I get an “Apple Event Time Out.” Anyone know why?
Rather than litter the forum posting with my whole script, I thought I would create a sample script that demonstrates the problem:
tell application "iTunes"
set sPlaylist to (get view of front window)
repeat with i from 1 to (count tracks of sPlaylist)
set fKind to kind of (track i of sPlaylist)
if fKind is "AAC audio file" then
-- convert aac to mp3 using iTunes
set newT to item 1 of (convert (track i of sPlaylist))
end if
end repeat
end tell
: In iTunes, select a playlist full of (unprotected) AAC files
: First, take above code and run it from Script Editor (should work great)
: Next, make a scpt file and put it in the iTunes Script folder to run it from within iTunes (will error)
Anyone have any advice on how to fix this? Thanks!