Re: Determining OS Version
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