0

I am not knowledgeable about shell scripting, but I'm using a command for merging files together, which works great on my computer, but when I move it to someone else's computer, it generates error 127.

The initial variable setup include also this:

set Processing to path to resource "Processing"
set AppendWorkflow to Processing & "AppendIndesignPDFPages.workflow" as string
set AppendWorkflow to quoted form of (POSIX path of AppendWorkflow)

The command I use in the longer script and that are generating the error are these:

    set command to "/usr/bin/automator " & AppendWorkflow
    set output to do shell script command

When working correctly (that is all the time in my computer) I get a set of merged documents into a single PDF. But, like I said, when running the same script on another computer we get the 127 error (the rest of the script runs correctly on the other computer). My searching around for an answer seems to indicate that, instead of a permissions problem (my first guess) I should have a full path to the command. Since I don't know enough about shell scripting, I can't tell if I have it or not.

Any hints to a solution?

Thanks.

1
  • Can you provide more information about the procedure? So your shell script calls an Automator workflow. Does that workflow take an argument, e.g. incoming file?
    – benwiggy
    Apr 24 at 7:37

1 Answer 1

0

Shell script error 127 is "Command not found".

One important point of clarification is that the code you have provided is AppleScript, not shell script; though clearly the AppleScript does run a shell command.

The best way of troubleshooting is to 'print' out every file path variable as it arises in the script, and see if everything is correct, both in form and in existence.

3
  • Yes, it is AppleScript, but the error happens when the shell script is executed. And yes, the second machine has the workflow because it is passed inside the Resource Folder of the App's package that runs the AppleScript. That is where it is located in my computer and simply pass the AppleScript app to the other machine to run, but the error still happens.
    – MBUST
    Apr 23 at 20:47
  • Thank you. I'll give it a try.
    – MBUST
    Apr 24 at 9:30
  • Unfortunately the list of files generated by "printing" out the file paths is as correct in every way in the problem system as it is in my own computer where the script runs perfectly fine. Thinking that this is, instead, a permissions problem, we went to the System Preferences -> Security & Privacy -> Privacy -> Full Disk Access and added the script app to the list. It still generates the error. . . .
    – MBUST
    Apr 25 at 8:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .