Mailing Lists: Apple Mailing Lists

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

Re: parameter passing from cocoa to AS




On 13/07/2006, at 21:30, Philip Lukidis wrote:

[long confusing hard to read code]

The first problem is this:

tell application "iTunes"
	tell every track of library playlist 1
		copy container to track_name
	end tell
end tell

returns  a list with of references to playlist1

{library playlist id 84 of source id 40, library playlist id 84 of source id 40, library playlist id 84 of source id 40, library playlist id 84 of source id 40, library playlist id 84 of source id 40, library playlist id 84 of source id 40, library ...


What you probably wanted is:

tell application "iTunes"
	return tracks of library playlist 1
end tell

Which is a list of tracks inside playlist 1

{file track id 101 of library playlist id 84 of source id 40, file track id 100 of library playlist id 84 of source id 40, file track id 98 of library playlist id 84 of source id 40, file track id 96 of library playlist id 84 of source id 40, file track id ...


I can't ignore this highly confusing code:

	tell every track of library playlist 1
		copy container to track_name
	end tell

1. it should return something, but you never return anything, the reader has to guess
2. variable holding a list of tracks called track_name?!




Nir Soffer

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

This email sent to email@hidden
References: 
 >parameter passing from cocoa to AS (From: "Philip Lukidis" <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.