Jump to content

Passing variables to Clipboard in Workflow


Recommended Posts

Hi,

 

I'm trying to pass some variables in a workflow. The set-up of the workflow is as follows:

 

Screen Shot 2017-01-10 at 15.02.10.png

 

Where the script is 

 

from datetime import date
from datetime import timedelta
import json

today = date.today()
offset = (today.weekday() - 2) % 7
last_wednesday = today - timedelta(days=offset)

d = {'alfredworkflow': 
		{'variables':
    			{'last_wednesday': last_wednesday.strftime('%Y-%m-%d')
			}
		}
	}

print json.dumps(d)

And the copy to clipboard part is:

 

SET @startdate = {var:last_wednesday};

SELECT ...

The issue is the {var:last_wednesday} part is coming up empty and I don't understand why as I've modelled this after another functioning workflow. When pasting I only get

 

SET @startdate = ;

 

Does anyone know where the error is?

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