Jump to content

Let Users Decide Which Modifiers Do What Action


Recommended Posts

I have a simple workflow that allows users to pull down their GitHub repos, search for them within Alfred, and then (currently) do one of 5 actions based on which modifier key is held down (i.e. ⌘-Enter will copy the repo URL, while just pressing Enter opens it in the browser).

 

What I would love to do is to set those actions & keys as the default, but allow users to modify which one points to what. I figured the easiest way was to use dropdowns to let the user change behavior (i.e. the user could have ⌘-Enter go to the repo's pull requests instead), but I have absolutely no clue how I would go about setting this up.

 

Does anyone have any examples I could utilize? I'm also doing my best to keep this as a workflow that can be included w/in Workflow Configuration, so that it could still be included in the Gallery.

Link to comment
On 1/30/2023 at 4:26 PM, niclake said:

I figured the easiest way was to use dropdowns to let the user change behavior

 

Indeed.

 

On 1/30/2023 at 4:26 PM, niclake said:

Does anyone have any examples I could utilize?

 

The 1Password workflow does this. Look for the multiple Arg and Vars objects organised like steps. It works well but is specialised. I’d recommend you try with an all-code approach in the Script Filter. You can set the modifiers programatically with the mods JSON key, so check each variable set by each dropdown, and depending on the value set the corresponding mods.

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