Created
August 27, 2011 22:49
-
-
Save peterblazejewicz/1175967 to your computer and use it in GitHub Desktop.
Launch Adobe Air application from Cocoa application and pass arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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