Re: OS version?
Re: OS version?
- Subject: Re: OS version?
- From: John Baltutis <email@hidden>
- Date: Thu, 15 May 2003 20:54:34 -0700
On 5/15/03, Emmanuel <email@hidden> wrote:
>
>
 --------------------------
>
 do shell script "defaults read | grep SystemVersionStampAsString"
>
 --------------------------
>
>
 is approximately 3000 times slower than:
>
>
 --------------------------
>
 system attribute "sysv"
>
 --------------------------
This only gives you->4134
Try:
copy my gestVersion_info("sysv", 4) to version_string
version_string
on gestVersion_info(gestalt_code, increment_value)
	try
		tell application "Finder" to ,
			copy my NumToHex((system attribute gestalt_code),
increment_value) to {a, b, c, d}
		if a is "0" then set a to ""
		set the version_string to (a & b & "." & c & "." & d) as string
		return version_string
	on error
		return "unknown"
	end try
end gestVersion_info
on NumToHex(theNumber, stringLength)
	set hexString to {}
	repeat with i from stringLength to 1 by -1
		set hexString to ((theNumber mod 16) as string) & hexString
		set theNumber to theNumber div 16
	end repeat
	return (hexString as string)
end NumToHex
which gives you->"10.2.6"
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: 
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.