#import #import #include #include AUTOFRAMEWORK(Foundation) AUTOFRAMEWORK(Cocoa) @interface appdelegate : NSObject @end void main(void) { if(OSX_VERSION < 100700) [NSAutoreleasePool new]; [NSApplication sharedApplication]; NSObject *delegate = [appdelegate new]; [NSApp setDelegate:delegate]; NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager]; /* Register a call-back for URL Events */ [appleEventManager setEventHandler:delegate andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; [NSApp run]; } @implementation appdelegate - (void)application:(id)arg openFiles:(NSArray*)file { int i,n; NSString *s; n = [file count]; for(i=0; i