Re: 'do shell script' error has me stumped
Re: 'do shell script' error has me stumped
- Subject: Re: 'do shell script' error has me stumped
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 6 Jul 2009 07:15:23 -0400
Once again, I failed to reply to the list... but that's OK, since I
misread the question and thought "fax make" was just "make" and there
was a Makefile involved. D'oh! Sorry for the confusion, Matt. Let's
try again:
The command 'gs' is installed somewhere not listed in the default
command search path. You have something in your shell startup files
(.bash_profile, probably) that modifies PATH, but those files don't
get run when you "do shell script".
In Terminal, type
which gs
to find out where the gs command lives. Then you can add that
directory to the command search path when you run the fax command.
For example, if the output of the above is
/opt/local/bin/gs
then do this:
do shell script "PATH=\"$PATH:/opt/local/bin\" fax make /faxfile.ps"
If you're feeling brave you can edit the "fax" script and either add
that PATH= assignment to it or replace all references to 'gs' with the
full path. Then you won't have to do something like the above every
time you want to call it from AS.
On Sun, Jul 5, 2009 at 7:05 PM, Matthew
Strange<email@hidden> wrote:
> I have encountered a problem that has me stumped. I'm hoping it's a simple
> thing for those with more 'do shell script' experience than I...
>
> I'm trying to script the sending of a fax. Step 1 is converting a postscript
> file into the proper format. In Terminal, it goes like this (given the .ps
> file is at the root of the boot volume):
> fax make /faxfile.ps
>
> That is simple enough, and it works perfectly. My simple understanding is
> that I ought to be able to AppleScript that thusly:
> do shell script "fax make /faxfile.ps"
>
> But it fails. Following the command with ' 2>&1' to get the standard error
> reveals the error:
> /usr/bin/fax: line 801: gs: command not found
>
> My limited experience tells me perhaps the wrong shell is being used, but
> I'm at a loss on what to do next. I've tried variations on the theme (quoted
> form, different file locations, etc.) all without success. So... what I am
> doing wrong?
>
> Thanks in advance,
> Matt Strange
> Autograph Systems
> www.autographsystems.com
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden