forgetfulfellow Posted May 27, 2021 Share Posted May 27, 2021 (edited) It's a bit late, so I might just be doing something dumb... But anyways, I have this code in my Script Filter: #!/usr/bin/env bash export PATH="$PATH:$node_path:/usr/local/bin:/usr/bin" node $node_flags javascript-file.js comments "{var:task}" And I'm getting this error: Code 1: undefined:1 {var:task} ^ SyntaxError: Unexpected token t in JSON at position 1 I have an Alfred Variable Object assigning the `task` variable to a value, but I'm not sure how to use it. Could I get some help? Thanks!! Edited May 27, 2021 by forgetfulfellow Link to comment
deanishe Posted May 27, 2021 Share Posted May 27, 2021 (edited) 2 hours ago, forgetfulfellow said: but I'm not sure how to use it When Alfred runs a script or any code you’ve put in a Script box, its puts all your workflow variables in the process environment. {var:task} variable macros don’t work in Script boxes. Use the language’s mechanism for reading environment variables, instead. So in your case – bash – that’s just $task. Same as what you’re doing with $node_path by the looks of it. Edited May 27, 2021 by deanishe forgetfulfellow 1 Link to comment
forgetfulfellow Posted May 27, 2021 Author Share Posted May 27, 2021 That worked! Thanks @deanishe 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