Jump to content

Running query in AppleScript

Recommended Posts

I'm trying to right run the below query as AppleScript but it Alfred doesn't seem to replace the "$1" with the passed in query (i have set "with input as argv"). However it works with "{query}" (and setting with input as (query"). It is because I'm right running it as AppleScript? Other ways to run this?




tell application id "com.runningwithcrayons.Alfred" to search "pw $1"



Also, side question, but I'm trying to send the text to the Alfred bar and only found this way to do it, any easier (in-built) way to do this?




Link to comment

with input as argv does not mean “use $1”, that’s just how Bash and Zsh determine the first argument. You have to use the appropriate syntax for each language. When you make a Run Script and change the language, Alfred shows example code that tells you how to do it. In AppleScript it’s item 1 of argv.


Please avoid pinging directly in new posts, as there are many people who are able and eager to help with basic questions but may get discouraged if they see a direct request. You learn best by teaching, so I encourage others to participate. In addition, please use the “Workflow Help & Question” for these queries (I have moved your post). The Advanced Rips & Tricks posts should be kept without replies so as to not cause confusion.

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