ok, so I have a progBar that works perfectly fine when a song is playing. But if no song is playing and you go to the tab with the progbar i get a NSInternalscripterror(8). Obviously this is because the progbar doesn’t know what to do when no song is playing. I need to know what to put in so it just sets itself to zero when no song is playing. Here is my code (it’s in an idle handler)
using terms from application "iTunes"
tell application "iTunes"
set track_time to the finish of the current track
end tell
end using terms from
tell window "mainWindow"
set the content of progress indicator "progBar" of tab view item "controller_tab" of tab view "myTab" to 0
set the maximum value of progress indicator "progBar" of tab view item "controller_tab" of tab view "myTab" to the_time
end tell
using terms from application "iTunes"
tell application "iTunes"
set trackTime to the player position
end tell
end using terms from
increment progress indicator "progBar" of tab view item "controller_tab" of tab view "myTab" of window "mainWindow" by trackTime
tell application "Finder" to set the visible of every process whose name is "iTunes" to false
return 1