Jump to content

“Keyword filter” or “keyword conditional”


vitor

Recommended Posts

There are many workflows that need configuring before being used (mainly the ones that need some type of account login/setting). However, there's no practical way of implementing that via Alfred. I find making users edit settings manually or having a separate option that'll always show in the results, for an action you typically only run once, to be non-optimal experiences.

For this purpose, I have two workflows that employ a script filter, that does something like this

if (settings_file_exists)
    show xml with
        text — “configure your account”
        arg — <some_string_to_let_the_script_know_it_is_a_configuration> {query}
else
    show xml with
        text — “do your action”
        arg — {query}

Even though this works well with DownVid, since only the configuration is needed (the else part takes no input); with PinAdd, not so much.

The problem here is that since PinAdd takes {query} as the xml’s arg, if your computer is slow at the moment or you type too fast and then press return, Alfred will act immediately, without waiting for the xml to rebuild/re‐output with the updated {query}. Realistically, I only need the xml to build once, and then take the full, correct, untruncated {query} as the argument, where requested.

Perhaps script filters aren’t build around this idea, but there is clearly a need for it, as currently you only get one of the worlds — either you can show different options depending on the case but you can’t really type some action to be passed through (script filters), or you can get the action perfectly but without having options (keyword input).

My suggestion is then, perhaps instead of creating more options in script filters for specific cases, maybe create a separate category like “keyword filter” or “keyword conditional” or some better name. What this would do is allow you to specify some code to run as soon as you enter its name (much like script filters do), but this code would run only once, outputting some predefined xml, and would take a full argument passed through, much like the keyword input.

Edited by Vítor
Link to comment
Share on other sites

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