Building a bit on my Smile Version Checker.
This shows how to use ASObjC instead of `mdfind` to find an app via its Bundle-ID.
Smile is the app I'm looking for.
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/05/02 03:54
# dMod: 2016/05/14 08:53
# Appl: AppleScriptObjC + XMLLib.osax
# Task: Get Path to Application Bundle ID using ASObjC.
# Aojc: True
# Libs: None
# Tags: @Applescript, @Script, @System_Events, @XMLLib.osax, @Read, @Keys, @Plist
-------------------------------------------------------------------------------------------
use framework "Foundation"
use scripting additions
-------------------------------------------------------------------------------------------
set bundleID to "com.satimage.Smile"
set theURL to current application's NSWorkspace's sharedWorkspace()'s URLForApplicationWithBundleIdentifier:bundleID
set appFilePathHFS to theURL as text
set infoPlistFile to alias (appFilePathHFS & "Contents:Info.plist")
-------------------------------------------------------------------------------------------
# Getting keys from a Smile's info.plist file using the XMLLib.osax:
-------------------------------------------------------------------------------------------
set _plist to PlistOpen infoPlistFile
set smileVersion to PlistGet _plist key "CFBundleShortVersionString"
set smileBundleVersion to PlistGet _plist key "CFBundleVersion"
PlistClose _plist
{smileVersion, smileBundleVersion}
-------------------------------------------------------------------------------------------