Re: OS 9 or Classic, that's the question :-)
Re: OS 9 or Classic, that's the question :-)
- Subject: Re: OS 9 or Classic, that's the question :-)
- From: Nigel Garvey <email@hidden>
- Date: Wed, 29 Oct 2003 14:47:53 +0000
Michael Slomski wrote on Tue, 28 Oct 2003 11:02:05 +0100:
>
Thanks a lot,
>
>
Here is my way how I've got it running:
>
>
tell application "Finder"
>
set myVersion to version
>
set myVersion to (last word of myVersion)
>
>
set oldDelims to AppleScript's text item delimiters
>
>
set AppleScript's text item delimiters to "."
>
set myFirst to text item 1 of myVersion
>
set mySecond to text item 2 of myVersion
>
>
set myFinderVersionNum to (myFirst & "," & mySecond) as number
>
if myFinderVersionNum < 10 then
>
set isOS9 to true
>
else
>
set isOS9 to false
>
end if
>
>
-- here follows more stuff :-))
>
end tell
A nice, brief way to do this - as compiled under OS 9 - is:
tell application "Finder"
set isOS9 to ((computer "sysv") < 4096)
end tell
In OS X's Classic mode, the same script decompiles - and should be
written - thus:
tell application "Finder"
set isOS9 to ((system attribute "sysv") < 4096)
end tell
The number returned by computer/system attribute "sysv" is a value which,
when written in hexadecimal notation, looks like the system version in
decimal. :-) 4096 is 1000 in hexadecimal. In OS 10.2.8, the number
returned is 4136, which is 1028 in hexadecimal. In OS 8.6, the number is
2144, which is 860 in hexadecimal. Perhaps a more accurate name for
'isOS9' would be 'isNotOS10'. :-)
NG
_______________________________________________
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.