Re: Droplet for disks with duplicate names
Re: Droplet for disks with duplicate names
- Subject: Re: Droplet for disks with duplicate names
- From: Dave Lyons <email@hidden>
- Date: Wed, 21 Sep 2005 19:07:35 -0700
Laine,
I tried your script on 10.4.2, and (though I was surprised by my
result) it's working perfectly for me. I used Disk Utility to make
"foo1.dmg" and "foo2.dmg", and renamed both mounted disks to "foo".
Their indices are 9 and 10 on my system. It could always tell them
apart (I tried dragging from the Desktop as well as from the Computer
window).
I tried similar tests, such as:
tell application "Finder"
display dialog (count of item (choose folder))
-- one disk "foo" contains 1 item, and my other disk "foo"
contains 5
end
...which also works, though it's "fragile" in that a seemingly small
change in syntax, omitting "item", will cause the reference to be
converted through an 'alias "foo:"' form, which then confuses the two
disks. (Changing "item" to "disk" or to "folder" still works OK.)
If the script below confuses the two disks as written, I'd like to
get some more details of your configuration so I can reproduce the
problem. Or, if there is a larger script that fails, I'd be
interested to experiment with that as well. It might or might not be
possible to find some syntax that avoids converting through a pathname.
Cheers,
--Dave (who works on Finder, including Finder Scripting)
On Sep 21, 2005, at 10:20 AM, Laine Lee wrote:
I ask something like this every year or so, I think, but I'm having
trouble
searching the list today.
If you have two disk volume icons on your desktop with the same
name, and
you drop one of them on a droplet made from this script (I used
10.4.2)
you'll get the same result no matter which one you drop.
on open selection
tell application "Finder"
repeat with i in selection
display dialog (index of (a reference to disk i)) as string
end repeat
end tell
end open
How do you construct a droplet so that unique information about the
disk
whose icon you dropped will be returned if another disk volume of
the same
name is also mounted on the desktop?
Thanks.
--
Laine Lee
email@hidden
http://lonestar.utsa.edu/llee
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden