Re: [Slightly OT] Scripting Bridge in Leopard
Re: [Slightly OT] Scripting Bridge in Leopard
- Subject: Re: [Slightly OT] Scripting Bridge in Leopard
- From: Philip Aker <email@hidden>
- Date: Thu, 01 Nov 2007 16:41:52 -0700
On 2007-31-10, at 07:23, Rob Stott wrote:
I guess this is kind of off topic, but as it relates to automating
apps in Mac OS X... Has anyone had a play with Scripting Bridge?
I was wondering if it might have any advantages over AppleScript
for automation but so far I can't even get the example in the
'Scripting Bridge Programming Guide' to work.
I'm thinking I'm probably missing something obvious (pretty
likely!). Anyone got a sample 'Hello World' type thing they'd be
prepared to share?
This follows on Chris Nebel's example by eliminating the leaks:
/*
gcc -framework Foundation -framework ScriptingBridge -o sbit sbit.m;./
sbit
*/
#import <Foundation/Foundation.h>
#import "iTunes.h"
int main( int argc, char *argv[] ) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
iTunesApplication *iTunes = [SBApplication
applicationWithBundleIdentifier:@"com.apple.iTunes"];
if( iTunes != nil ) {
fprintf( stderr, "%s\n", [[iTunes version] UTF8String] );
}
[pool release];
return 0;
}
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden