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: Walter Ian Kaye <email@hidden>
- Date: Thu, 30 Oct 2003 14:25:52 -0800
At 08:01p +0000 10/29/2003, kai didst inscribe upon an electronic papyrus:
on Wed, 29 Oct 2003 03:05:34 -0800, Walter Ian Kaye wrote:
> OK, I just thought up a new method:
>
> tell app "Finder" to set OS9 to (application file id "MACS" as alias as
string) does not end with ":"
>
> Howzzat? :-D
I'm not sure the 'as alias' is needed, boo -
It's how I get the ":".
but I still can't seem to get the above to work in OS 9.1 or 9.2.1.
There's even a problem here with a simpler form:
tell application "Finder" to get application file id "MACS"
--> Finder got an error: Can't get application file id "MACS".
Ah... well yes, now that in itself would render the colon moot. ;)
So it would reduce down to 'exists application file id "MACS"'.
tell app "Finder" to set notOSX to not (exists application file id "MACS")
==========================================================
on Wed, 29 Oct 2003 10:35:51 +0100, Michael Slomski wrote:
>> tell app "Finder" to set OS9 to (get version)'s word - 1's item 2 is "."
>
> Interesting, with OS X 10.3 it will return false.
Correct, Michael. (OS9 is not OS X.)
> I will check it later, what it will return with OS 9 (no classic)
It should return true (as it does here).
I decided to write an international-friendly routine, which should
work with any decimal separator:
tell application "Finder" to set fv to version
set fv to fv as string
return VersionList(fv)
on VersionList(vers)
local vers, nList, vList, theChar, curChar
set nList to "0123456789"
set bList to "ab_cdefghijklmnopqrstuvwxyz" --Option+S betw. b & c
set vList to {}
set theChar to ""
repeat with curChar in vers
if curChar is in nList then
set theChar to theChar & curChar
else if curChar is in bList then
set end of vList to 0 + theChar
set theChar to curChar as item
else
set end of vList to 0 + theChar
set theChar to ""
end if
end repeat
if character 1 of theChar is in nList then set theChar to 0 + theChar
set end of vList to theChar
vList
end VersionList
However, in spite of my code-shortening example, I personally favour the
Finder/[computer/system attribute]/"sysv" approach for this type of
situation - as suggested by Richard Morton and Nigel Garvey.
_______________________________________________
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.