Re: how to eject a firewire drive natively
Re: how to eject a firewire drive natively
- Subject: Re: how to eject a firewire drive natively
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 10 Apr 2004 21:59:43 -0700
On 4/10/04 9:42 PM, "Graff" <email@hidden> wrote:
>
To my knowledge no one ever tried to answer it so I'm assuming it has
>
everyone stumped or that no one really cares to investigate it.
>
>
It certainly seems like buggy behavior to me. I see no really good
>
reason why this command should react so differently when executed from
>
the command line as opposed to through a "do shell script" command. I
>
even attempted to duplicate the environment that the "do shell script
>
command" uses and I still didn't get the same result as through
>
AppleScript.
It's likely something very basic:
In the Terminal, the shell is whatever it's set to: usually bash in Panther,
tcsh in Jaguar (? - or maybe that was in 10.1), zsh in OS 10.1 (? or maybe
that was 10.0). I don't know why they keep changing it. If you did an
Archive & Install of Panther then you inherited whatever you had in Jaguar.
Anyway, AppleScript doesn't use any of the above: it uses sh. (And then
there's something about sh emulating one of the others, or vice versa - I
forget.) Anyway, it's probably a difference to do with which shell. You
could 'do shell script' on a script file you've created (which you can also
do in Applescript via the open for access and write commands), where the
first line is a shebang line that sets the shell to the one you have in your
Terminal. Then diskutil will probably work as you like.
Then again, it may be due to the result that AppleScript returns not being
in the correct stream. That's quite likely since you say that
do shell script "diskutil eject " & posixPath & "> /dev/null 2>&1 &"
ending in "> /dev/null 2>&1 &" is what works. It makes no difference if you
consider it a workaround, if in fact it's actually the solution. There are
about 500 messages about this in the archives, with this solution being
presented many times for various shell scripts, several times with
explanations by Chris Nebel and others. Somebody will probably repeat the
explanation again. Or you could try searching teh archives (yes, I know).
--
Paul Berkowitz
_______________________________________________
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.