johnofcamas Posted May 18, 2016 Share Posted May 18, 2016 (edited) I'm trying to kick off a keyboard maestro macro from a workflow, and I have a couple variables that get captured during the workflow. I'd like to have my 'NSAppleScript' action use these, but I'm not sure how. Here is the example applescript with what I *thought* would work. on alfred_script(q) -- ignoring application responses tell application "Keyboard Maestro Engine" setvariable "alfred_build_product" to "{var:product}" do script "Build target (from Alfred)" end tell -- end ignoring end alfred_script Edited May 18, 2016 by johnofcamas Link to comment
deanishe Posted May 20, 2016 Share Posted May 20, 2016 I don't think it's possible using Run NSAppleScript. Alfred passes variables as environmental variables to its child processes, but NSAppleScript isn't run in a separate process, so no variables… Instead of Run NSAppleScript, use a normal Run Script Action with Language = /usr/bin/osascript (AS). Then you can access your variables thus: setvariable "alfred_build_product" to (system attribute "product") 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