• 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: Determining OS Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining OS Version


  • Subject: Re: Determining OS Version
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 24 Jan 2010 18:23:12 -0600

On Jan 24, 2010, at 5:02 PM, Marconi wrote:
Luther Fuller's mention that /System/Library/CoreServices/SystemVersion.plist contains a version string may prove helpful, but the plist may have to be parsed in AS.

Yes, the .plist will have to be parsed in AS, but that is easier than you may think.

I said:
tell application "System Events" to set systemRecord to (value of property list file ((systemFile as text)))

The record systemRecord contains your useful information.

The information you need is in a record, 'systemRecord'. All you have to do is look at (double-click) any property list file (it will open with Property List Editor) and note that you want the items 'ProductVersion' and 'ProductBuildVersion' of the record. So your script becomes ...

set systemFile to ((path to startup disk) as text) & "System:Library:CoreServices:SystemVersion.plist"
tell application "System Events" to set systemRecord to (value of property list file ((systemFile as text)))
set sysVersion to (ProductVersion of systemRecord)
set buildNr to (ProductBuildVersion of systemRecord)
display dialog "Mac OS version " & sysVersion & " (" & buildNr & ")"

I ran it, it works!

 _______________________________________________
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

References: 
 >Re: Determining OS Version (From: John Baltutis <email@hidden>)
 >Re: Determining OS Version (From: Marconi <email@hidden>)

  • Prev by Date: Re: "Open for access weirdness"
  • Next by Date: how to check whehter a application is active or not and the frontmost application
  • Previous by thread: Re: Determining OS Version
  • Next by thread: Re: Determining OS Version
  • Index(es):
    • Date
    • Thread