samuellinde Posted May 26, 2016 Share Posted May 26, 2016 (edited) I'm trying to get workflows variables to parse in a Run Script action. I.e I want to run "/usr/local/bin/tag -a {var:tag} {var:files}" but the script parser tries to replace the colon with a forward slash. Edit: Found out the answer myself (which was indeed fairly logical when you think about it). When using the recommended "with input as argv" setting, I could access the variables with $tag and $files. :-) Edited May 26, 2016 by samuellinde Link to comment
Andrew Posted May 26, 2016 Share Posted May 26, 2016 I'm trying to get workflows variables to parse in a Run Script action. I.e I want to run "/usr/local/bin/tag -a {var:tag} {var:files}" but the script parser tries to replace the colon with a forward slash. Workflow variables are set as environment variables within scripts, so you can access them directly regardless of the script mode ({query}, argv, external). Cheers, Andrew Link to comment
FroZen_X Posted May 26, 2016 Share Posted May 26, 2016 Workflow variables are set as environment variables within scripts, so you can access them directly regardless of the script mode ({query}, argv, external). Cheers, Andrew Just out of curiosity Andrew. As we talked about the Problem on twitter, that this doesn't work in applescript, do you think you can make it work at some point? Right now my workaround is to combine vars via delimiter like here: {var:filename}:{query} And then i split it via applescript like this: set x to "{query}" set text item delimiters to {":"} set {filename, destination} to text items 1 thru 2 of x Link to comment
Andrew Posted May 26, 2016 Share Posted May 26, 2016 Just out of curiosity Andrew. As we talked about the Problem on twitter, that this doesn't work in applescript, do you think you can make it work at some point? Right now my workaround is to combine vars via delimiter like here: {var:filename}:{query} And then i split it via applescript like this: set x to "{query}" set text item delimiters to {":"} set {filename, destination} to text items 1 thru 2 of x I've been trying to work out why osascript doesn't respect the passed in environment through NSTask like the others do, it seems to be a bug with osascript, but I'll keep working at it! FroZen_X 1 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