RE: parameter passing from cocoa to AS
RE: parameter passing from cocoa to AS
- Subject: RE: parameter passing from cocoa to AS
- From: "Philip Lukidis" <email@hidden>
- Date: Thu, 13 Jul 2006 17:07:36 -0400
- Thread-topic: parameter passing from cocoa to AS
Thanks for your reply. I'm still waiting for my AS reference book to arrive, so my scripts leave much to be desired I'm sure, and my AS knowledge is fuzzy. Replies inline below.
> -----Original Message-----
> From: Nir Soffer [mailto:email@hidden]
> Sent: Thursday, July 13, 2006 4:31 PM
> To: Philip Lukidis
> Cc: email@hidden
> Subject: Re: parameter passing from cocoa to AS
>
>
>
> On 13/07/2006, at 21:30, Philip Lukidis wrote:
>
> [long confusing hard to read code]
>
Sorry about that. I could have explained more to relieve the ambiguity. I find there is a lot of code necessary to call from cocoa to AS.
> 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 shall try this, thank you.
> 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
Sorry, I should have been more explicit. I mentioned that when "I invoke the script above from my cocoa program, and I receive a list descriptor with all the track objects.". Granted I did not understand the difference between references to tracks and track objects, but I did mention what I received from this script.
> 2. variable holding a list of tracks called track_name?!
>
>
In the interest of brevity, I snipped out the cocoa code which iterates over the list descriptor. So In fact since I have 13 tracks in my iTunes library, I received a list with 13 elements holding references to each track.
>
> Nir Soffer
>
>
Thanks again,
Philip Lukidis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden