Jump to content

Is osascript working? ( or what am I doing wrong )


Recommended Posts

Hi,

 

I have a simple test workflow consisting of a Keyword box which triggers a /bin/bash Run Script box. The script inside the box is 1 line:-

 

echo "some text"

 

Feeding this into a Post Notification box works as expected, but when I feed it into a /usr/bin/osascript Run Script box which contains the following:-

 

 

set temp to "{query}"


set the clipboard to temp

 

 

nothing gets written to the clipboard. Changing 'set the clipboard to "more text"' doesn't work either until I delete the first line 'set temp to "{query}"'.

 

 

Is it a bug?

Link to comment

No, the keyword is unique as far as I know and no argument is required.

 

 

Test%20workflow.png

 

 

It's so simple that it's got to be either something wrong with my Mac or a funny in Alfred.

 

Just tried changing the osascript box to a /bin/bash box and that doesn't work either!

Edited by samispade
Link to comment

No, the keyword is unique as far as I know and no argument is required.

 

 

Test%20workflow.png

 

 

It's so simple that it's got to be either something wrong with my Mac or a funny in Alfred.

 

Just tried changing the osascript box to a /bin/bash box and that doesn't work either!

 

Instead of setting the value to the clipboard in applescript, why not just use the Copy to Clipboard output module in the workflows area? 

Link to comment

I don't want to copy to the clipboard, I was just trying to debug something else I was doing and thought this would help me to see what was happening. I was trying to pass "{query}" to the rightmost script box and it wasn't doing anything. Deleting the line with "{query}" in and the rest of the script runs.

Edited by samispade
Link to comment

I don't want to copy to the clipboard, I was just trying to debug something else I was doing and thought this would help me to see what was happening. I was trying to pass "{query}" to the rightmost script box and it wasn't doing anything. Deleting the line with "{query}" in and the rest of the script runs.

 

Gotcha. Ok for testing then, add a Keyword (input), Run Script (action), and a Large Type (output). Set the keyword, then in the Run Script item , set the language to /usr/bin/osascript and for the script...

set temp to "{query}"
return temp

 

Connect the 3 modules. Mouse over the individual pieces and a little tab should show up on the right side, click that and drag to the next module. That will connect the modules to one another. That should show anything entered into that workflow in Large Type. That should show that it IS functioning and is able to pass the data between the different pieces

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