I have an application that is responding to 'GURL' (get URL) apple events from a custom registered URL protocol. It is being registered properly and works fine when the application is already running, but if the application is not running already it will just start the application, but not respond to the url like the API indicates it should.
I'm not quite sure how to have Xcode attach to the process immediately as it's started from an external source, so I'm not sure if the application is being started with arguments indicating the url? If not, is there a way to determine that the application was started from the GURL apple event whenever it is started?
I am initializing the handler the following way:
- (void)applicationWillFinishLaunching:(NSNotification *)notification
{
// Register the URL handler
NSAppleEventManager* manager = [NSAppleEventManager sharedAppleEventManager];
[manager setEventHandler:self
andSelector:@selector(getUrl:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
}