Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iTunes beat me again!



I'm stumped. Why doesn't this script work?


tell application "iTunes" set theSelectedPlaylistNames to {"K-SAL Authors On Tour - Live!", "K-SAL Most Recent 3 Purchases"} set theSelectedPlaylists to {} repeat with i from 1 to the number of items in theSelectedPlaylistNames set thisPlaylist to (the first playlist of source "Library" whose name is item i of theSelectedPlaylistNames) set theSelectedPlaylists to theSelectedPlaylists & thisPlaylist end repeat end tell


Here's the resulting event log:

tell application "iTunes"
	get playlist 1 of source "Library" whose name = "K-SAL Authors On Tour - Live!"
		user playlist id 5450 of source id 39
	get user playlist id 5450 of source id 39
		user playlist id 5450 of source id 39
		"Can't make «class cUsP» id 5450 of «class cSrc» id 39 of
application \"iTunes\" into type vector."

It stops with the first iteration of the second statement of the loop.
I use this exact same language in a larger script that adds playlists
to a list and it works just fine. Why does it fail _here_?

(Naturally, this isn't the whole script. It's just the hunk that's
acting up...but this hunk reproduces the problem precisely.)


-- A. _______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.