Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS Version script



On 08-05-27, at 08:42, Andreas Kiel wrote:

Hi all,

Maybe a stupid question again. I got following script part:

on getOS()
	try
		set the hexData to system attribute "sysv"
		set hexString to {}
		repeat 4 times
			set hexString to ((hexData mod 16) as string) & hexString
			set hexData to hexData div 16
		end repeat
		set the OSversion to the hexString as number
		log {"OSversion", OSversion}
	on error theError
		log {"OS version not found", theError}
		set OSversion to 1000
	end try
	return OSversion
end getOS

running this on my machine the above returns 1049

looking at the "About This Mac" tells me 10.4.11.
It's not that important - but what's happening there?

It's an anomaly with the way the system version was previously packed into a 32-bit integer.


New ones are "sys1", "sys2", "sys3" as in:

{system attribute "sys1", system attribute "sys2", system attribute "sys3"}

--> {10, 5, 2}

or

do shell script "sw_vers -productVersion"

for text.


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

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

This email sent to email@hidden
References: 
 >OS Version script (From: Andreas Kiel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.