###MACRO: Is App Installed
~~~ VER: 1.0 2017-01-06 ~~~
@APP @TEST Does App Exist.kmmacros (3.5 KB)
- The AppleScript in this macro determines if an app with a given bundle ID has been installed on your Mac.
- It does this without causing the app to run, if it is installed.
- Perhaps it is obvious to others, but I found it very hard to find a script that would do this.
- In this TEST Macro/Script, I check for "BBEdit", which has a bundle ID of
- I hope you will find this helpful.
- If you know of a better method, please post.
try tell application "Finder" to get application file id "com.barebones.bbedit" set appExists to true on error set appExists to false end try return appExists
EDIT: 2017-01-07 4:23 PM CT
You can use this script to get the Bundle ID:
set targetApp to "BBEdit" set bundleID to get id of application targetApp return bundleID -->com.barebones.bbedit