RE: iTunes programming question
RE: iTunes programming question
- Subject: RE: iTunes programming question
- From: "Philip Lukidis" <email@hidden>
- Date: Tue, 11 Jul 2006 17:30:45 -0400
- Thread-topic: iTunes programming question
> > Thanks for your answer. Right now I'm doing preliminary research
> > only because I have not received any specifications yet. Perhaps
> > when I know more I could post a more specific question.
> >
> > I had found the Apple Events documentation, but I was hoping that
> > Apple would have documentation on the AE necessary for
> > communicating with iTunes. That was quite optimistic as it
> turns out.
>
> You won't find anything that specific; heck, most application
> developers don't provide any documentation beyond a dictionary
> resource (yes, this is lame). But if you know how to construct an AE
> and you know the application's scripting interface, putting the two
> together is straightforward.
>
It's often the case that documentation of that specificity is lacking. But like you say "reverse engineering" some Applescript with a dictionary into AE shouldn't be too hard as soon as I have a handle on AE (which I'm learning about at this moment).
> Have you done application scripting before, know how the Apple Event
> Object Model works, etc? If not, it'd be a good idea to do some
> background reading first as the basic principles are the same from
> app to app (though quality and consistency do vary). There's a good
> overview of the original technology at <http://www.cs.utexas.edu/
> users/wcook/papers/AppleScript/AppleScript95.pdf>. Matt Neuburg's
> book might be worth a look - it's the most programmer oriented.
> There's also a discussion and tutorial in the appscript
> documentation
> on my site.
>
Thanks for those references, as they could prove handy. I don't have much experience in scripting, so Matt Neuburg's book will probably be quite useful. I've ordered it, and I'm looking forward to reading it.
> For finding your way around iTunes, it's mostly a case of read its
> dictionary, look at existing scripts, experimenting yourself and
> asking about when you get stuck. Suggest you start here: <http://
> www.apple.com/applescript/itunes/index.html>
>
>
Thanks, I've already found those scripts which Apple released and have started to play around a bit with them. I've used the NSAppleScript class to compile and execute a trimmed Apple supplied script from a cocoa test program. This script simply gets some basic information for each track in the main iTunes library (~3200), but it nevertheless takes 38 seconds to execute on a dual G5 with 1 GB of RAM. I'm not sure if sending AE messages would trim this down. We'll see.
> > As for the development language, I assume for now that I would be
> > using Objc. This online resource
> http://www.cocoadev.com/index.pl?
> > CallAppleScriptFunction coupled with Apple's documentation is a
> > useful starting point for me.
>
> Calling into AS is useful if a decent chunk of your code is written
> in it. If you're doing pretty much everything in ObjC anyway
> then you
> might as well use the Cocoa API to build your AE descriptors (easier
> than using Carbon) and the Carbon API for the actual sending (Cocoa
> doesn't have an equivalent to AESend, so you still have to dip into
> Carbon for that). Best to ask on the AS Implementors list
> about doing
> that
> <http://lists.apple.com/mailman/listinfo/applescript-implementors>.
>
As someone on another list already pointed out to me, an open source project called EyeTunes does this to some degree. This will be of immense help I'm sure.
> BTW, as Jon says, even if you do the final implementation in ObjC
> it's still a good idea to prototype it in a scripting language. If
> AppleScript's not your thing then you might consider Python
> +appscript; Python's a good cognitive fit for folk coming from a C/
> ObjC/C++ background, and a lot more popular with programmer types.
>
> HTH
>
> has
> --
> http://freespace.virgin.net/hamish.sanderson/
>
I'm prototyping some very basic AS scripts right now, but soon I will have to start reading the AS docs/book. Since so far I have not seen other scripting languages giving iTunes control support, I'll have to stick to AS/AE for now. I'll only convert AS to AE if precompiled AS is too slow.
Your help in pointing me in the right direction is much appreciated...thanks!
Philip Lukidis
_______________________________________________
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