-------------------------------------------------------------------------------------------
# Auth: Christopher Stone (Liberal help with ASObjC by Shane Stanley)
# dCre: 2016/05/02 03:54
# dMod: 2016/05/14 09:22
# Appl: AppleScriptObjC + XMLLib.osax
# Task: Read Keys from Plist File 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 smileInfoPlistPath to (POSIX path of (theURL as text)) & "Contents/Info.plist"
-------------------------------------------------------------------------------------------
# Getting keys from a Smile's info.plist file using the ASObjC:
-------------------------------------------------------------------------------------------
set theDict to current application's NSDictionary's dictionaryWithContentsOfFile:smileInfoPlistPath
set asojcSmileShortVersionString to (theDict's valueForKeyPath:"CFBundleShortVersionString") as text
set asojcSmileCFBundleVersion to (theDict's valueForKeyPath:"CFBundleVersion") as text
-------------------------------------------------------------------------------------------
{asojcSmileShortVersionString, asojcSmileCFBundleVersion}