I want to use Python and atomac
module to trigger an application in macOS like following scripts:
atomac.launchAppByBundleID()
app_win = atomac.getAppRefByBundleId(app_bundle_ID)
But I don't know how to get the Bundle ID (app_bundle_ID
) of the application.
As we know, bundle id is located in the info.plist of an app, so both
PlistBuddy
anddefaults
could help/usr/libexec/PlistBuddy -c 'print CFBundleIdentifier' /Applications/Xcode.app/Contents/Info.plist
or
defaults read /Applications/Xcode.app/Contents/Info.plist CFBundleIdentifier
which prints