I'm trying to figure out how to tell a browser (in this example, Google Chrome) how to open in incognito mode. I'm using the NSWorkspace
openurls
method, but I can't find any way of send the application extra parameters.
func openUrlWithBrowser(url: String, bundleIdentifier: String) {
var eventDescriptor: NSAppleEventDescriptor? = NSAppleEventDescriptor()
var errorInfo : NSDictionary? = nil
var appleEventManager:NSAppleEventManager = NSAppleEventManager.sharedAppleEventManager()
var urls = [NSURL(string: url)!]
NSWorkspace.sharedWorkspace().openURLs(urls, withAppBundleIdentifier: bundleIdentifier, options: NSWorkspaceLaunchOptions.Default, additionalEventParamDescriptor: nil, launchIdentifiers: nil)
}