Jump to content

Using workflow variables in Run Script actions


Recommended Posts

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 by samuellinde
Link to comment

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

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

 

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!

Link to comment

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...