Jump to content

How to create a workflow / snippet that accepts 2 arguments? e.g. \\expand $1 $2 --> "Hi, I'm a snippet with args $1 and $2!"


Joshua

Recommended Posts

Hello! I'm searching for a way to make snippets that accept more than 1 argument.

 

I've found a way to do it with 1 argument, using the \\hellomsg example here:

 

https://www.alfredapp.com/help/workflows/triggers/snippet/snippet-triggers-with-dynamic-inputs/

 

Doing it with 2 arguments is kind of touched on in the following thread, but I don't need it to open up a browser window, plus the scripting is greek to me.

I just want to be able to type, for example, 

 

\\expand $1 $2

 

and it gets replaced with

 

Hello, I'm a snippet with $1 and $2 as arguments

 

So when I type

 

\\expand foo bar

 

It gets replaced with


 

Hello, I'm a snippet with foo and bar as arguments

 

Anyone have a workflow or a way to create such a system?

 

Thanks!

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