jeffsui Posted June 17, 2016 Share Posted June 17, 2016 I'm a little confused as to how an external script is supposed to get its arguments My script looks like this: #!/usr/local/bin/python import urllib2,json,os,sys import xml.etree.ElementTree as ET query = sys.argv[1] And i'm getting no arguments. When i run the same code as an internal python script i have ZERO issues. Is there something i'm missing on how you are supposed to pass arguments into an external script? Link to comment
deanishe Posted June 17, 2016 Share Posted June 17, 2016 How are you calling the external script? Link to comment
wyllyan Posted June 20, 2016 Share Posted June 20, 2016 (edited) I have the same ”problem” but with a bash script.I’m calling it this way: http://cl.ly/20190P0A2B3p Edited June 20, 2016 by wyllyan Link to comment
deanishe Posted June 20, 2016 Share Posted June 20, 2016 You guys are probably going to have to upload the actual workflow, not screenshots and code. The most likely reason an external script would fail is because you haven't set its executable bit: chmod +x script.sh Link to comment
jeffsui Posted June 20, 2016 Author Share Posted June 20, 2016 Ok so here is my script: I tried without the #!/usr/local/bin/python But i get "the script may not exist or doesn't have execute permission error - even though it has permission 777 And when I try to run `pb1 test` I'm just having ZERO luck getting my arguments to pass in. Link to comment
wyllyan Posted June 20, 2016 Share Posted June 20, 2016 Sorry, here is my Workflow: http://cl.ly/3c3L0C201l2c Link to comment
deanishe Posted June 20, 2016 Share Posted June 20, 2016 Sorry, here is my Workflow: http://cl.ly/3c3L0C201l2c That should work. Looks like it may be a bug in Alfred. Ok so here is my script: Those are screenshots of your script. Post the workflow. Link to comment
jeffsui Posted June 20, 2016 Author Share Posted June 20, 2016 (edited) The workflow is posted here (or rather a similar one). https://github.com/jeeftor/workflow py1 will call the internal script py2 wil link to /tmp/pyTest.sh (so you might need to move the script to the temp dir) In theory the subtitle of the result will show the query string Edited June 20, 2016 by jeffsui Link to comment
Andrew Posted June 20, 2016 Share Posted June 20, 2016 Yep, this is totally a bug in Alfred - sorry! I'm not quite ready to do a 3.0.3 pre-release, but here is an early 3.0.3 build which will fix the issue (should be stable for day to day use): https://cachefly.alfredapp.com/Alfred_3.0.3_681.zip Cheers, Andrew Link to comment
wyllyan Posted June 20, 2016 Share Posted June 20, 2016 Thanks Alfred's Dad and you guys! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now