'm writting a script that lets me select a Playlist to play from my iPod that will run/work from the Finder Script menu. I’ve managed to get a list of the Playlists but I can’t get iTunes to play my selection, I get this error:
iTunes got an error: Can’t get item 1 of every playlist whose name = {“Alternative”}.
Can anyone help?
Here’s my code:
tell application “iTunes”
set MyiPod to “iPod”
set iPod_playlists to the name of every playlist of source MyiPod
tell current application
choose from list iPod_playlists with prompt “Choose a Playlist.”
–copy the result as list to {the Choosen_Playlist}
set Choosen_Playlist to the result
tell application “iTunes”
set the_playlist to item 1 of (every playlist whose name is Choosen_Playlist)
set the_total to count every track in the_playlist
set n to 1
play track n of the_playlist of source MyiPod
end tell
end tell
end te