Hello,
I am tring to figure out why this doesnt work:
set smartButton to button returned of (display dialog ("Do you want to keep your Smart Playlists that are currently on your iPod?") buttons {"No", "Yes"} default button {"Yes"} with icon 1)
tell application "iTunes"
repeat with i from 1 to the count of sources
if the kind of source i is iPod then
set thePod to the name of source i as text
end if
end repeat
tell source thePod
delete every track of playlist thePod
if smartButton is "Yes" then
repeat with thePL from 1 to the count of device playlists in thePod
if playlist thePL is smart then
-- do nothing
else
delete playlist thePL
end if
end repeat
else
delete every track of playlist thePod
delete every user playlist
end if
end tell
end tell
The problem i think lies in the fact that the number of device playlsits returned is 0 and it should be 2. I have tried to change it from device playlist to user playlist and even just playlist, but it always returns 0.
Any ideas why this isnt working properly?
Thanks,
JO