RE: possible to pass direct object param from cocoa to applescript?
RE: possible to pass direct object param from cocoa to applescript?
- Subject: RE: possible to pass direct object param from cocoa to applescript?
- From: "Philip Lukidis" <email@hidden>
- Date: Wed, 19 Jul 2006 12:03:16 -0400
- Thread-topic: possible to pass direct object param from cocoa to applescript?
Thanks for your reply. I was about to reply to the list and say that I found a workaround for the problem by using the Applescript keyword "id". Since I can query each iTunes track object successfully from cocoa and get its track id, source id, and playlist id (as longs), and since I can send longs from cocoa to my AS scripts, the following script works well enough for me:
on OnPlayTrack(pid, tid, sid)
tell application "iTunes"
tell library playlist id 51 of source id sid
set ct to (get track id 63)
play ct
end tell
end tell
end OnPlayTrack
OnPlayTrack(51, 63, 37)
Basically I specify each object with 3 longs, so I don't need to pass a direct object to my script from my cocoa app.
thanks,
Philip Lukidis
> -----Original Message-----
> From: applescript-users-bounces+plukidis=email@hidden
> [mailto:applescript-users-bounces+plukidis=guillemot.com@lists
> .apple.com
> ]On Behalf Of Jon Pugh
> Sent: Wednesday, July 19, 2006 11:35 AM
> To: email@hidden
> Subject: Re: possible to pass direct object param from cocoa to
> applescript?
>
>
> At 9:49 AM -0400 7/19/06, Philip Lukidis wrote:
> >I need to be able to pass a direct object parameter from my
> cocoa application to a script which would be talking to
> iTunes. Is this possible? I have been able to pass simple
> parameters from cocoa to AS (like numbers and strings), but
> so far not objects. For example, I need to be able to play
> any track whose object I have already queried.
> >
> >Are raw Apple Events my only recourse?
>
> Sort of. OSADoEvent specifically allows you to send an
> AppleEvent of your construction to a script. So yes, you'll
> need to construct a valid AE which your script can handle.
>
> Jon
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list
> (email@hidden)
> Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden