Skip to content

Instantly share code, notes, and snippets.

@peterblazejewicz
Created August 27, 2011 22:49
Show Gist options
  • Save peterblazejewicz/1175967 to your computer and use it in GitHub Desktop.
Save peterblazejewicz/1175967 to your computer and use it in GitHub Desktop.
Launch Adobe Air application from Cocoa application and pass arguments
NSString *appPath = [[NSWorkspace sharedWorkspace] fullPathForApplication:@"TourDeFlex.app"];
if(!appPath) return;
NSURL *url = [NSURL URLWithString:appPath];
NSArray *args = [NSArray arrayWithObjects:@"-show", @"exampleName", nil];
NSDictionary *options = [NSDictionary dictionaryWithObject:args
forKey:NSWorkspaceLaunchConfigurationArguments];
NSError *launchError = nil;
[[NSWorkspace sharedWorkspace] launchApplicationAtURL:url
options:NSWorkspaceLaunchDefault
configuration:options
error:&launchError];
if(launchError) {
// handle launch error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment