Jump to content

Unable to run External script from Workfolder Couldn't posix_spawn: error 8


Recommended Posts

Posted (edited)

I have an Applescript which I have copied to my workflow folder.

workflowfolder.thumb.jpeg.48a17a556c98fa4da0eaf45fa3663177.jpeg

 

I followed the tips from this post

 

  • The preference in Alfred to "Run AppleScripts instead of opening" (found in: "Alfred Preferences -> File Search -> Advanced -> AppleScripts [ ]  Run AppleScripts instead of opening)
  • modified permissions of .scpt file with Terminal using `chmod +x myFile.scpt`

Permissions.thumb.jpeg.e833523014db88d06e0c71336a400ac9.jpeg

  • Used a RunScript Action and entered Filename. File is recognized (if I click on open file it opens the correct script).

 

RunScript.thumb.png.dd54514153f6a47034970293c8ab6644.png

When I now try to execute the workflow I get the error:

 

Unable to run task! Reason: Couldn't posix_spawn: error 8

 

Error.jpeg.fa61ab8564514a32c3fac01bc1118036.jpeg

 

 

What am I doing wrong? I am still new to using Alfred with scripts.

 

Another question is how can I get the query (a string) into the script for further processing by the script?

 

 

Thanks

Edited by Marc
Posted
2 hours ago, Marc said:

The preference in Alfred to "Run AppleScripts instead of opening" (found in: "Alfred Preferences -> File Search -> Advanced -> AppleScripts [ ]  Run AppleScripts instead of opening)

 

That doesn’t affect this case.

 

2 hours ago, Marc said:

What am I doing wrong?

 

Impossible to say because all relevant information is blurred and the workflow was not shared. Without information we cannot know what is wrong or how it needs to be fixed.

 

2 hours ago, Marc said:

Another question is how can I get the query (a string) into the script for further processing by the script?

 

When using External Script in a Run Script, the arguments are set from the output of the previous object. Alternatively, give the arguments yourself by calling the the script with e.g. /bin/zsh.

Posted (edited)

Hi Vitor,

 

thanks for helping again.

I blurred the username in permission list ("marc") and the scriptname ("myscript") for privacy reasons.

 

I used the exact filename in theRun ScriptFilter. And Alfred also recognizes the correct file. Since it opens when I click Open file.

 

Username of files in filelist and in path of error message are the same.

Edited by Marc
Posted

Without inspecting the workflow itself it’s not possible to help further. If you don’t want to share the real one you can create a smaller use case which still causes the problem and share that. Think of it like taking your car to a mechanic; you can show them pictures and describe the issue, but some problems require looking under the hood ourselves and poking around to see what’s wrong.

Posted (edited)

I just created a workflow which you can find here.

 

The script reads data from a CSV file.
After that some text substitutions and calculations take place (omitted in the example workflow attached).
At the end the results should be passed as variables for further use in Alfred.

 

Edited by Marc
Posted

Ah ok. I thought I can just copy the file to the workflow folder. 

 

After copying the code over to a text I had some error messages since the formatting was messed up. So it took me a while to test and give feedback.

Script gets now executed without throwing the earlier error message.

 

But I cant get the variable I set with a Var Object in the script.

 

Bildschirmfoto2023-02-12um01_52_02.png.01271cac37e00b23223687759bd6b4af.pngBildschirmfoto2023-02-12um01_38_07.thumb.png.460f21360e1d82efef53568b29ff6ed0.png

 

I get an error s_nr not defined.

If I hardcode a s_nr for testing in the script it works as expected but I need the s_nr to be dynamic from the query.

 

Sorry for the newby questions I am still learning how to combine Alfred with scripting.

And thanks again for your help.

 

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...