Skip to content

Instantly share code, notes, and snippets.

@erdemildiz
Last active September 1, 2022 13:15
Show Gist options
  • Save erdemildiz/79380299bbccd508475dce38e9baa7f7 to your computer and use it in GitHub Desktop.
Save erdemildiz/79380299bbccd508475dce38e9baa7f7 to your computer and use it in GitHub Desktop.
Browser Bundle Identifiers
Safari : com.apple.Safari
Chrome: com.google.Chrome
Firefox: org.mozilla.firefox
Opera: com.operasoftware.Opera
// Learn Bundle Id on Termina
osascript -e 'id of app "Opera"'
@erdemildiz
Copy link
Author

erdemildiz commented Sep 1, 2022

Open in macos with swift

 let configuration = NSWorkspace.OpenConfiguration()
        configuration.promptsUserIfNeeded = true
        let application = NSWorkspace.shared.urlForApplication(withBundleIdentifier: <BUNBDLE_ID>)!
        NSWorkspace.shared.open(
            [url],
            withApplicationAt: application,
            configuration: configuration) { runningApp, error in
            print("-- ", runningApp)
            print("-- ", error)
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment