View Full Version : Control SlimServer _from_ iTunes (Windows)

Craig, James (IT)
2004-10-05, 03:22
On Windows you can access iTunes from any programming language that has
a COM or OLE interface.
But I think on a Mac your only way to access iTunes is from AppleScript?
There are Perl modules that support appleScript and iTunes but I don't
know if that includes events.

The iTunes Windows SDK has some examples of how to use iTunes events -
is there an equivalent document for the Mac?


-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Anton F. van
der Kraaij
Sent: 05 October 2004 10:52
To: Slim Devices Discussion
Subject: [slim] Control SlimServer _from_ iTunes (Windows)

Hi James,

> For what it's worth, I've translated Anton's script into Windows
> compatible Perl.

looks complicated to me! :-) I dont have windows at home, so cant really
it. Is this perl support a windows only feature?

> Secondly the script loops every second which is clumsy - you
> may not hear a song through to the end on the SlimServer.

That is also a problem with the applescript I had.

> (I did try making it event driven but no luck there - the Perl OLE
> support is 'alpha' so I'm not entirely surprised.)

An event driven script would solve the problem indeed. You could then,
depending on what event, append songs to a list instead of just playing
it. I
have _no_ idea how to do this. Either in applescript or an iTunes
Does anybody know how to do this, i.e. catch apple events? Either in
applescript of perl or anything?

> The best use I can think of is using the iTunes 'party shuffle' to
> slimServer but if I was doing this I'd rather 'insert' the playlist
> items, because then they'd be played to completion and you'd keep a
> history of the playlist beyond that which is in iTunes?
> Any thoughts let me know!

I just enjoy controlling my slimserver from iTunes. Either random play
album play or anything. :-)



Anton F. van der Kraaij
2004-10-05, 03:39

thanks for the link looks like what you need to control itunes from perl.

> The iTunes Windows SDK has some examples of how to use iTunes events -
> is there an equivalent document for the Mac?

I would think yes, but I have been looking and looking and could not find
anything on catching apple events for itunes. I did find something on the
apple site about writing an itunes visual plugin, which catches itunes
events, but nothing really useful I think.