Search code examples
macosapplescript

Quit application by bundle identifier (AppleScript)


I'm trying to quit an application with an AppleScript by providing its bundle identifier.

My code does not work:

tell application "System Events" to quit (application whose bundle identifier is "com.apple.Notes")

or

quit app "com.apple.Safari"

The second code asks where the app to quit is located... no description


Solution

  • Your second snippet is pretty close, you need application id

    quit application id "com.apple.Safari"