Re: shell script with stdin from Applescript...
Re: shell script with stdin from Applescript...
- Subject: Re: shell script with stdin from Applescript...
- From: Michael Terry <email@hidden>
- Date: Wed, 02 Jul 2003 19:16:03 -0700
On 7/2/03 4:16 PM, "David Crowe" <email@hidden> wrote:
>
I want to run a shell script with input to be created by an
>
applescript, something like:
>
>
>
do shell script "/usr/bin/unixapp <<$
>
line 1
>
line 2
>
line 3
>
$"
>
I can get this (the part in quotes, obviously) working fine in
>
Terminal, but I get an "fread error 0" when trying this from
>
AppleScript.
Hard to say without seeing the script and input, but are you, by chance,
using an editor which uses carriage returns rather than the shell's
linefeeds? For instance, the scripts I ran from SE 1.9 that follow that form
don't work, but they do in SE 2[1].
In that case, the following will fix it:
set text item delimiters to ASCII character 10
do shell script (paragraphs of "/usr/bin/unixapp <<$
line 1
line 2
line 3
$" as text)
Mike
[1] For any who'd like to try the latest beta of the new-fangled SE 2, a
couple tips: If you run in to the crasher that occurs when you try to save a
document, just delete the com.apple.scripteditor2 preferences. Cleared up
immediately for me. Another bug for me was documents resizing on first save
and obscuring the top several lines of text. You can fix this by turning on
the navigation bar in the View menu; let's face it, you wanted to turn it on
anyway.
Incidentally, has anyone figured out how to make the Code Assistant work? I
haven't been able to get it to do anything useful.
_______________________________________________
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.