Re: Scripting iTunes
Re: Scripting iTunes
- Subject: Re: Scripting iTunes
- From: Jeff Porten <email@hidden>
- Date: Thu, 23 Aug 2007 08:53:15 -0400
On Aug 23, 2007, at 6:17 AM, Chris wrote:
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:
It's a dereferencing error; AppleScript is breaking down the second
statement and returning something that can't be duplicated. The
error it's throwing indicates that the problem is in the assignment
statement you're using for myPlaylist -- it's a reference to a list
item. The usual workaround looks like this:
repeat with i from 1 to count playlists of mySource
set myPlaylist to get item i of playlists of mySource
. . .
end repeat
In general, though, if you've got working code, you're good to go.
You only need to understand why statement #2 didn't work well enough
to write statement #1 -- which apparently you do.
The other question I have is, if I change the line to look at a
shared library instead:
It gives an error, that I can't figure out:
Might be an iTunes restriction on what it allows you to do with
shared libraries, so you don't accidentally copy a song or cause some
other form of Armageddon. My troubleshooting would look like this:
1) doublecheck the dictionary to make sure that shared library
inherits from library;
2) if yes, give up; it's DRM causing the breakage, not AppleScript.
Best,
Jeff
_______________________________________________
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