Benben Posted April 5, 2021 Share Posted April 5, 2021 Hi there i have a workflow where a hotkey would trigger the "Keyword" input and the pass the argument into a var utility and set "title" var to the current query. In the end i have an alfred script which will post to wordpress self hosted blog. I have tried this: on alfred_script(q) set myBlogUsername to "myusername" set myBlogPass to "mypassword" set poststrut to {post_type:"post", post_status:"publish", post_format:"status", post_title:"{var:title}", post_content:"test"} tell application "https://myblogdomain.com//xmlrpc.php" set myPosts to call xmlrpc {method name:"wp.newPost", parameters:{"1", myBlogUsername, myBlogPass, poststrut}} return myPosts end tell end alfred_script But it won't pass the var, just use it as a string. i also tried {$title} and ${title}... Link to comment
deanishe Posted April 5, 2021 Share Posted April 5, 2021 {var:...} expansion doesn’t work in Script boxes. Please see the stickied thread on workflow variables: Note: Workflow variables don't work at all in Run NSAppleScript. Don't use that. Use Run Script with Language = "/usr/bin/osascript (AS)" instead. Link to comment
Benben Posted April 5, 2021 Author Share Posted April 5, 2021 That's really overwhelming for me. can you please make a simple example of using one variable in alfredscript? Thanks any way! Link to comment
deanishe Posted April 5, 2021 Share Posted April 5, 2021 10 minutes ago, Benben said: can you please make a simple example of using one variable in alfredscript? The simplest possible example is already in the article. 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