Re: OS version questions
Re: OS version questions
- Subject: Re: OS version questions
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 20 Jul 2003 08:00:13 -0700
On 7/19/03 4:08 AM, "Nigel Garvey" <email@hidden>
wrote:
>
> I use the following, similar to what Rob offered, but a lot shorter. I've
>
> added Dave's display dialog. If you are running OS X or late OS 9.1/2,
>
> 'computer' will compile to 'system attribute'.
>
>
>
> display dialog "You are running system version " & GetSystemVersion()
>
>
>
> to GetSystemVersion()
>
>
>
> tell application "Finder" to set hexNum to computer "sysv"
>
> set {a, X} to {hexNum div 4096, hexNum mod 4096}
>
> set {b, y} to {X div 256, X mod 256}
>
> set {c, d} to {y div 16, y mod 16}
>
>
>
> if a "0" then set b to "" & a & b
>
> set OSvers to "" & b & "." & c & "." & d
>
>
>
> return OSvers
>
>
>
> end GetSystemVersion
>
>
Neat. :-) You've already pointed out in a follow-up that the 'if' line
>
should start 'if a is not...', but the "0" should also be a *numeric* 0,
>
otherwise the rest of the line will always be carried out.
Ooops. right, Thanks Nigel.
_______________________________________________
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.