johnhamill Posted November 12, 2021 Share Posted November 12, 2021 I am a diehard user of the "vi editor". I would like to use this editor to edit scripts directly (and not within the Alfred script window). I thought I might be able to stick with the"vi editor" if I were to use "External script". I attempted this but ran into problems. Reading the forum post below however, it doesn't look like this is possible (because of single arguments and whitespace etc - see the very last post). What I am doing at present is copying and pasting from Alfred to the "vi editor" and vice versa. There is also the option of editing the info.plist file directly - but I think that is a little too dangerous really. Thanks for your help. Link to comment
deanishe Posted November 12, 2021 Share Posted November 12, 2021 (edited) 1 hour ago, johnhamill said: it doesn't look like this is possible Either you've misread the post or you'll need to explain precisely what you think the issue is. External Script is the preferred way to include scripts in workflows. They work just fine for everybody else. The information in that post is also somewhat out of date because more Alfred elements do now pass multiple arguments (though the user's search query naturally remains a single argument). Edited November 12, 2021 by deanishe Link to comment
vitor Posted November 12, 2021 Share Posted November 12, 2021 7 hours ago, johnhamill said: I attempted this but ran into problems. What, specifically? From your description you seem to be doing it correctly (assuming you remembered to make the script executable and have it in the correct directory), so you’ll need to expand on what the issue was so we’re able to diagnose and help. Link to comment
johnhamill Posted November 12, 2021 Author Share Posted November 12, 2021 Mac OSx 11.3 Alfred 4.6 (1266) The error I receive is a Posix spawn error (relevant screenshot enclosed). I enclose a screenshot of the permissions I have set. I have set them to superuser/owner (rws). rwx permissions should be adequate, but I decided to run it as superuser (just in case). I have also checked the permissions on the recursive directories down to the workflow itself (all 'rwx' for the owner 'johnhamill'). The permissions on directory of the workflow itself also seem fine (screenshot enclosed). The script runs successfully when NOT used in an external script. Workflow and screenshot link: https://www.dropbox.com/sh/caso70jllct0efu/AAAc-qedy24K6q7idURYjImka?dl=0 Thanks. Link to comment
deanishe Posted November 12, 2021 Share Posted November 12, 2021 (edited) Your script isn't running because it doesn't have a shebang. Also, you can't use setuid on script files, only binaries. Set the script permissions to 755. Anything else is probably a bad idea. Edited November 12, 2021 by deanishe Link to comment
johnhamill Posted November 13, 2021 Author Share Posted November 13, 2021 My bad. Rarely use the shebang (although it is best practice) as all my scripts are run from the command line. Thanks. Link to comment
vitor Posted November 13, 2021 Share Posted November 13, 2021 3 hours ago, johnhamill said: Rarely use the shebang (although it is best practice) as all my scripts are run from the command line. Those should have a shebang anyway so you can run them without specifying the interpreter on the command line. Link to comment
deanishe Posted November 13, 2021 Share Posted November 13, 2021 3 hours ago, johnhamill said: all my scripts are run from the command line. Seems like all the more reason to use a shebang. 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