Re: Mounting and Dismounting local or server volumes on Tiger
Re: Mounting and Dismounting local or server volumes on Tiger
- Subject: Re: Mounting and Dismounting local or server volumes on Tiger
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 17 Oct 2005 19:18:24 -0700
- Thread-topic: Mounting and Dismounting local or server volumes on Tiger
On 10/17/05 6:09 PM, "John C. Welch" <email@hidden> wrote:
> On 10/17/05 19:57, "Dave Lyons" <email@hidden> wrote:
>
>>> Question 1:
>>> tell app "Finder"
>>> eject "G3400-X"
>>> end tell
>>
>> I'm always surprised when I see stuff like that work: This is asking
>> Finder to eject a string. True, Finder manages to figure out what
>> you mean, but it's better to write:
>
> You need to have a chat with the Standard Additions folks. "list disks"
> returns a list of unicode text strings with the disk name, nothing more.
> Since the OS is giving you that, and nothing more, it would be MORE unusual
> to have the only obvious way to eject a disk not work on what the OS gives
> you.
>
> Considering that the output of list disks in SA is much cleaner and easier
> to work with than the output of the Finder, I think it's blind luck that you
> don't see more of that kind of thing than you do.
Nonsense. 'list disks' (a scripting addition possibly originally 3rd-party
incorporated into Standard Additions in OS 8.1) happens to return just the
names of of the disks, rather than the alias format. It couldn't ever return
the Finder reference since it has nothing to do with the Finder. There's no
Standard Addition (info for, path to) etc. that can MAKE things or even act
on things in the file system. Only the Finder (and now System Events) can do
that. The Finder is a scriptable app that requires you behave yourself and
use proper Finder references, and that's how it should be. It's great that
it coerces aliases to Finder objects - there's a 1-to-1 relationship. Some
other apps will allow alias-type paths, but there can be inconsistencies. at
least with aliases there will be an error if it doesn't exist. I agree with
Dave that strings probably shouldn't coerce to Finder objects since there
are so few other situations where that can work. But since they do, you can
make use of it.
--
Paul Berkowitz
_______________________________________________
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