Jump to content

How to have two-phase keyword?


Recommended Posts

I'll use `git` as an example.

 

When I input `git` in alfred, I expected alfred can give all it's submodule names (like `clone`, `info`, `commit`) as available choices. Then I can keep typing `c`, Alfred keeps telling me there's "clone" and "commit" are available. (image how bash completion works)

 

After I typed "git commit" in Alfred, it then will tell me the exact message for that keyword.

 

Ideally all the second-phase keyword can be generated by script on the fly. But if it's not possible, just hardcode the second-phase keyword is acceptable.

 

So, is this already available in Alfred?

Link to comment

Yes, what you’re looking for is the “Script Filter” option on workflows. When making a new workflow you have a “Script Filter XML Format” under “Examples”. You can take a look at that, and there are a lot of workflows on the forum that use them (there are even workflow handlers in various languages that’ll make that work easier for you).

 

If you have any trouble implementing that, feel free to ask — people on the forums are usually very helpful.

Link to comment

I'll use `git` as an example.

 

When I input `git` in alfred, I expected alfred can give all it's submodule names (like `clone`, `info`, `commit`) as available choices. Then I can keep typing `c`, Alfred keeps telling me there's "clone" and "commit" are available. (image how bash completion works)

 

After I typed "git commit" in Alfred, it then will tell me the exact message for that keyword.

 

Ideally all the second-phase keyword can be generated by script on the fly. But if it's not possible, just hardcode the second-phase keyword is acceptable.

 

So, is this already available in Alfred?

 

 

Yes, what you’re looking for is the “Script Filter” option on workflows. When making a new workflow you have a “Script Filter XML Format” under “Examples”. You can take a look at that, and there are a lot of workflows on the forum that use them (there are even workflow handlers in various languages that’ll make that work easier for you).

 

If you have any trouble implementing that, feel free to ask — people on the forums are usually very helpful.

 

There are also numerous posts in this forum detailing the XML format, how to use script filters, and more. Those would probably be a better resource than just looking at a script filter example.

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