At 13:23 -0500 4/2/2002, Chris Nandor wrote:
>At 08:02 -0800 2002.04.02, Andrew O. Mellinger wrote:
>>Is this last example correct?  From what I am led to believe the
>>"form:enum(name)" should instead be  "form:indx"
>
>Yes.
>
>>   I am actually getting the index of some item on the desktop, and it
>>isn't a disk.  Subesquent numbers are files and folders.
>
>I don't know; perhaps it isn't always supposed to be the startup disk.  I
>don't even recall where I got that information.

When talking to the Finder (and speaking of Mac OS 9 and below for the
moment), Disk 1 of the null container (Finder) is the startup volume, 2 is
the next one mounted, etc (I forget whether "holes" are filled in by new
mounts if a mounted disk is unmounted).

Item 1 of the null container is some item within the Desktop...seemingly
the Trash at least for Andrew, and for me on my 9.1 machine.
(I did this the easier-for-me way:
tell application "Finder"
     item 1
end tell
which should produce the same event as the example modified to use index
instead of enum).  Checking, the AEPrint format in the log as given by
Script Debugger shows the event as
    core\getd{
        '----':obj {
            form:indx,
            want:type(cobj),
            seld:1,
            from:'null'()
        }
    }

In Mac OS X, the same AppleScript script produces the same event.
tell application "Finder"
    name of items
end tell
suggests strongly that my two disks in Mac OS X (10.1.3; AppleScript
1.8.2b3) are items 1 and 2.  But remember that whether the disks are shown
at all in Mac OS Xis a user preference, and when they are not shown they
are not--per experiment--available as items of the Finder null object (they
are still there as disk 1, disk 2, etc.  (Now that the disks are not shown
I'll leave them not shown for a while...I had been intending to find out
whether I like that better or not, but my supply of round tuits was very
low.)

As it happens at the moment in Mac OS 9.1, my startup disk is item 4, and
my other disk is somewhere near the end of the list, after most of the
clutter.

But in any case, I don't think
   form:enum(name), seld:shor(1)}
has much chance of being right.

And it appears that item n is an unreliable way to learn about disks.

  --John

-- 
John Baxter   [EMAIL PROTECTED]      Port Ludlow, WA, USA

Reply via email to