• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 'do shell script' error has me stumped
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'do shell script' error has me stumped


  • Subject: Re: 'do shell script' error has me stumped
  • From: Philip Aker <email@hidden>
  • Date: Sun, 5 Jul 2009 18:30:37 -0700

On 2009-07-05, at 16:05:16, Matthew Strange 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


I'd say it's because /usr/bin/fax (it's just a shell script) wants to use GhostScript to convert PostScript files to the fax format. It's possible that you have an install of GhostScript on your machine and it's parent directory is included in your PATH variable. To check, open Terminal and run:

% echo $PATH

and

% which gs

to see what shows. It's also possible you have an alias to GhostScript called 'gs'.

'do shell script' doesn't know about the values in your personal PATH because it's not running as a logged in "Matthew Strange". You might be able to run the command specifying 'gs' something like:

% export gs=/path/to/ghostscript;fax make /faxfile.ps;



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?

Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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
References: 
 >'do shell script' error has me stumped (From: Matthew Strange <email@hidden>)

  • Prev by Date: 'do shell script' error has me stumped
  • Next by Date: RE: A simple script for FileMaker Pro
  • Previous by thread: 'do shell script' error has me stumped
  • Next by thread: Re: 'do shell script' error has me stumped
  • Index(es):
    • Date
    • Thread