Jump to content
jerzygangi

How to do Partial / Mixed Keyword Inputs?

Recommended Posts

I am a long-time Alfred user, and today I created my first workflow, but I need help.

 

My workflow runs a terminal command from Alfred -- very, very simple. To do this I created a new Workflow, added a keyword input object, and linked it to a terminal command object. For the keyword, I typed "create ruby on rails project" since that's what it does.

 

Here's my problem. Alfred only finds it if I type, "create ruby on rails project", or the beginning of that string. If I type, "create rails project" Alfred won't find it. Or if I type "rails project" Alfred won't find it. This sucks because I can't remember exactly what phrase to type, and so I can't find it.

 

How do I make it so, if I type just parts of the keyword, Alfred will still find my workflow?

 

Also, there is a chance I'm doing this entirely wrong in Alfred, and there's a better way. So please let me know if that's the case.

 

Thank you!!

Edited by jerzygangi

Share this post


Link to post

This is simplistic, but you can simply create multiple keywords that all lead to the same Action. Obviously, this isn't optimal, but I've used it in workflows to have "long" and "short" keywords for the same action.

Share this post


Link to post

Thanks for the idea smarg19, but won't work. I would have to create a dozen permutations for each workflow...

 

Anyone else? There must be a way to do this. I just want my workflow to work the way all of the other Alfred commands work.

Share this post


Link to post

Alfred works on the basic premise that you have a keyword and an argument, e.g. the open keyword before a file search, or the google keyword before a search string. The only side case to this is the default file and app search where the keyword can essentially be empty, but the argument and matching is still the filename (search phrase).

 

In your case, your best bet is to have a script filter with keyword 'create', then you have full control over any subsequent matches after this keyword, then make your script action create anything you like... e.g.

 

create php project

create rails project

create new folder ~/Desktop/bob

 

There are quite a few examples of workflows using script filters, take a look at the built in "Script Filter XML Format" example to see how to return results and suggestions into Alfred.

 

Cheers,

Andrew

Share this post


Link to post

Here's my problem. Alfred only finds it if I type, "create ruby on rails project", or the beginning of that string. If I type, "create rails project" Alfred won't find it. Or if I type "rails project" Alfred won't find it. This sucks because I can't remember exactly what phrase to type, and so I can't find it.

 

How do I make it so, if I type just parts of the keyword, Alfred will still find my workflow?

 

As Andrew says, that isn't how keywords work. If you can't remember your keyword, try to think of a better one. Preferably a much shorter one. In this case, I'd go with "rails" or "ror" (though I'd be much more likely to remember the former).

 

If you still have difficulty remembering the keyword, you can prefix all your own keywords with a character like ";", e.g. ";rails". That way, when you just enter ";", you should see a list of all your own keywords and nothing else.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...