Re: Play Playlist in iTunes
Re: Play Playlist in iTunes
- Subject: Re: Play Playlist in iTunes
- From: "Mr. Gecko" <email@hidden>
- Date: Fri, 3 Oct 2008 11:09:40 -0500
On Oct 3, 2008, at 10:10 AM, has wrote:
Michael Ash wrote:
On Thu, Oct 2, 2008 at 9:52 PM, Mr. Gecko wrote:
I know but I can't find out the AppleEvent for Play Playlist.
Is there some sort of a program that will parse the AppleScript
and make an
cocoa AppleEvent code.
If you just want the raw four-char-codes from an application's
dictionary so you can construct NSAppleEventDescriptors yourself,
you can obtain them in various ways: ASDictionary (on the appscript
site) can export raw application dictionaries as fairly readable
UTF8 files; Late Night Software's Script Debugger provides a very
nice GUI that can extract and display just about anything you can
think of; OS X's Script Editor or sdef tool can dump out application
dictionaries in raw XML format.
I already looked at that but it doesn't have an actual code for Play
Playlist
I found this though <class name="playlist" code="cPly" description="a
list of songs/streams" inherits="item" plural="playlists"> which if
you look at the output of AEDebugSends than you can see that that is
called when running the play playlist command.
Not quite, but you can get pretty close. Go to the section titled "An
Example" on this page:
http://www.cocoadev.com/index.pl?AEVTBuilder
It shows how to make Script Editor dump the Apple Events it's
sending,
and then how to translate this into code.
FWIW, the approach that ASTranslate uses is to install a custom
AESendProc into an AppleScript component and have the user run an
AppleScript. Any events sent by the script are intercepted by the
custom callback, which pulls the event apart and formats its
constituent parts as Python/Ruby/ObjC-style code; no manual
translation required. Pretty easy to do if you're interested in
providing a similar converter for AEVTBuilder; you could probably
hack one from its existing ObjC translator if you know any Python.
I am using that at the moment until I edit EyeTunes to do it for me.
NSAppleEventDescriptor *descriptor = [AEVT class:'hook' id:'Play'
target:[self applicationProcess:@"com.apple.iTunes"],
[KEY : '----'], [RECORD : 'obj ',
[KEY : 'form'], [ENUM : 'name'],
[KEY : 'want'], [TYPE : 'cPly'],
[KEY : 'seld'], [STRING : [playlist objectForKey:@"Name"]],
[KEY : 'from'], [DESC null],
ENDRECORD],
ENDRECORD];
[descriptor sendWithImmediateReply];
HTH
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden