-
-
Save pgtwitter/352c10dad9f808b829bfb7b20bf31e62 to your computer and use it in GitHub Desktop.
Open a URL with an application ( Objective-C / Cocoa )
This file contains hidden or 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
[[NSWorkspace sharedWorkspace] openURLs:@[url] | |
withApplicationAtURL:[NSURL fileURLWithPath:@"/Applications/Safari.app"] | |
configuration:nil | |
completionHandler:^(NSRunningApplication * _Nullable app, NSError * _Nullable error) { | |
[app activateWithOptions:NSApplicationActivateIgnoringOtherApps]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment