• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example


  • Subject: Re: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 14 May 2016 09:24:39 -0500

On May 14, 2016, at 09:18, Christopher Stone <email@hidden> wrote:
Then I grab the CFBundleVersion and CFBundleShortVersionString values directly from Smile's info.plist file using Satimage's XMLLib.osax.
______________________________________________________________________

Hey Folks,

Okay, let's grab those same values with ASObjC.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------
# 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
# Osax: XMLLib.osax { http://tinyurl.com/dc3soh }
# 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}

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
      • From: Shane Stanley <email@hidden>
References: 
 >ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example (From: Christopher Stone <email@hidden>)

  • Prev by Date: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
  • Next by Date: Re: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
  • Previous by thread: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
  • Next by thread: Re: ASObjC to Find an App with Bundle-ID and XMLLib.osax Read Plist Example
  • Index(es):
    • Date
    • Thread