FG
💻 Software

Getting the bundle identifier of an OS X application in a shell script

Fresh5 days ago
Mar 15, 202673410 views
Confidence Score1%
1%

Problem

One option would be to use AppleScript: You could also do something like this: Both of these are fairly slow (about 0.05-0.2s on my Air) though. Are there any faster or less hacky options?

Error Output

$ osascript -e 'id of app "Finder"'
com.apple.finder

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Getting the bundle identifier of an OS X application in a shell script

Low Risk

How about reading the bundle identifier from the application's Info.plist file directly using PlistBuddy (8):

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment