MACSCRPT Archives

April 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chuck Pelto <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sun, 13 Apr 2008 12:11:45 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (55 lines)
Greetings,

What's the syntax of a call to do this?

I've tried a lot of things, including getting all the tracks out of  
an existing playlist and trying to add them to a new playlist, but I  
keep getting errors.

		set thisPlaylist to playlist "Exercise"
		
		set testList to (every track of thisPlaylist) as list
		
		make new playlist with properties {name:"wake-up"}
		
		set wakePlaylist to playlist "wake-up"
		
		add testList to wakePlaylist

What I get is this in the log....

	get playlist "srcPL"
	-->	user playlist id 3591 of source id 43
	get every track of user playlist id 3591 of source id 43
	-->	{
			file track id 3640 of user playlist id 3591 of source id 43,
.
.
.
			file track id 3628 of user playlist id 3591 of source id 43
		}
	set shuffle of user playlist id 3591 of source id 43 to true
	count every track of user playlist id 3591 of source id 43
	-->	62
	make new playlist with properties {
		name:"newPL"
	}
	-->	user playlist id 3864 of source id 43
	get playlist "newPL"
	-->	user playlist id 3823 of source id 43
	add {
		file track id 3640 of user playlist id 3591 of source id 43,
.
.
.
		file track id 3628 of user playlist id 3591 of source id 43
	} to user playlist id 3823 of source id 43
end tell
Script “Test iTunes” finished
	-->	iTunes got an error: Can't make some data into the expected type.

So....what am I doing wrong here?

Regards,

Chuck

ATOM RSS1 RSS2