[Mono-osx] Access iTunes using C#

Lawson English lenglish5 at cox.net
Sun Jan 20 14:50:56 EST 2008


Bart Masschelein wrote:
> So if I get it right, there is no way around using Applescript. This  
> NSAppleScript or ScriptBridge both are concepts I've never heard of  
> before, but we're never to old to learn, are we? Suppose I create an  
> AppleScript to fetch all songs of a certain playlist, do the above  
> allow me to get this list in objc, and eventually to C#, where I can  
> for instance compare them with other playlists? Or in other words,  
> could I do something like this (under the premises that this is all  
> very premature):
>
>   

I'm not familiar with NSAppleScript or ScriptBridge, but the concepts 
seem foreign to the entire philosophy behind AppleEvents.


There's no plausible reason why direct calls to AppleEvents can't be 
made from C#, at least syntax-wise. There's a Python module that allows 
scripting of scriptable apps from Python. Perhaps it is using this 
ScriptBridge thing behind the scenes but there are plenty of cases where 
shims between two libraries exist and no-one gets worried about them.

The python syntax translates the AppleScript concept of "first word of 
second window" to "window[2].word[0]"

or something along those lines. Why can't a similar thing be worked up 
for C#?

Or has it and this is what you're complaining about?


Lawson




More information about the Mono-osx mailing list