Jump to content
vitor

“Keyword filter” or “keyword conditional”

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

Share this post


Link to post
Share on other sites

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