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: kai <email@hidden>
- Date: Wed, 29 Oct 2003 01:41:41 +0000
on Tue, 28 Oct 2003 11:02:05 +0100, Michael Slomski wrote:
>
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
>
>
Until now, it is running and working, but I will give Chris' solution also a
>
try because it seems shorter. And shorter is very times better because most
>
often you can make less errors :-)
While I can't vouch for the safety of using the Finder's version, Michael,
you could probably condense your approach. If you also reset the TIDs ("set
AppleScript's text item delimiters to oldDelims"), your routine would total
about 15 lines. But there could be a few ways to shorten it...
I assume you're replacing the decimal point with a comma to suit your
System's numbering format - although that also means that your script may
not travel too well. (As it stands, it doesn't work on my British system -
without additional trapping.) In fact, I wonder if TIDs and string-to-number
coercions are really necessary here at all.
You might, for example, get away with something like this instead:
------------------
tell app "Finder" to set OS9 to (get version)'s word - 1's item 2 is "."
------------------
---
kai
_______________________________________________
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.