I am trying to use the Scripting Bridge to control VLC. However, I seem unable to access all methods. I generated the file using:
sdef /Applications/VLC.app | sdp -fh --basename VLC
I can access properties such as vlc.pathOfCurrentItem
just fine. Even this notation works: [vlc pathOfCurrentItem];
.
However, all methods seem to be grouped into a VLCGenericMethods
protocol and seperate from the VLCApplication
interface. [vlc stop]
throws a compile-time error of: No visible @interface for 'VLCApplication' declares the selector 'stop'
.
What am I doing wrong? My code is literally:
VLCApplication *vlc = (VLCApplication *)[self.application sbApplication];
[vlc stop];
Scripting Bridge is buggy, crippled, and very prone to application conflicts. You may want to consider using AppleScript instead - the language may be crap, but it's the only supported option that knows how to speak Apple events right. The AppleScript-ObjC bridge takes most of the pain out of bridging between the two languages: here's a quick how-to.