Scripting iTunes
Scripting iTunes
- Subject: Scripting iTunes
- From: Chris <email@hidden>
- Date: Thu, 23 Aug 2007 20:17:05 +1000
I'm trying to figure out both applescript and scripting iTunes. I have
this script which works to copy one playlist to another:
tell application "iTunes"
set libSource to first item of (sources whose kind is library)
if not (exists playlist "MySmart") then
make new playlist with properties {name:"MySmart",
container:libSource}
end if
set nplaylist to playlist "MySmart"
set pl to (first item of (get playlists of (sources whose kind is
library)))
set allShared to (get playlists of (sources whose kind is library))
repeat with mySource in (sources whose kind is shared library)
repeat with myPlaylist in (get playlists of mySource)
if name of myPlaylist is "play1" then
duplicate tracks of playlist (name of myPlaylist) to
nplaylist
end if
end repeat
end repeat
end tell
I'm curious about the duplicate line, why this:
duplicate tracks of playlist (name of myPlaylist) to
nplaylist
works but this:
duplicate tracks of myPlaylist to nplaylist
doesn't:
iTunes got an error: Can't set user playlist id 348388 of source id 38
to every track of item 6 of {library playlist id 246666 of source id
246665, user playlist
The other question I have is, if I change the line to look at a shared
library instead:
set pl to (first item of (get playlists of (sources whose kind is
shared library)))
It gives an error, that I can't figure out:
iTunes got an error: Can't set user playlist id 686627 of source id 38
to every track of playlist "MiniPlay".
Can anyone give me any clues?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden