Jump to content

User configuration for keyboard shortcuts?


Recommended Posts

I have a few workflows that I'm sharing with others in a managed way (i.e. automatic updates, they can't modify the workflow itself). Providing standard keyword triggers for these is fine, though I do see that it can be customized, but I would like to provide keyboard shortcuts as well. I played around with a copy of the workflow and set up a new Hotkey trigger with the shortcut that I use. This works great! But I don't see a way to customize the Hotkey as part of the User Configuration for the workflow. 

 

I thought about a couple things to do here:

  1. I could ask everyone to create a second personal workflow which has their own keyboard shortcut and then executes the managed workflow. This is probably the route I'll go since it's easy enough, but it is annoying. 
  2. I could create a default Hotkey trigger in the managed workflow and then enable/disable this via the User Configuration if they don't want this shortcut. However, I don't see a way to enable/disable a Trigger via User Configuration. I could link the Trigger to an if/else block that checks the User Configuration, but I don't know how to test if that will still swallow the event from other applications that might be listening for that shortcut combo. 
  3. I could create a helper application which can be configured by Alfred (i.e. read the workflow User Configuration) and binds the correct keyboard shortcut to execute the workflow. This is a lot more work and a lot more moving pieces. 

 

The nicest option would be for Alfred to offer a Keyboard Shortcut prompt in the User Configuration for a workflow. Are there any feature requests for something like this or other options I should consider?

Link to comment

Welcome @fixrepeating,

 

By default, workflow customisations are kept during updates. Notice the checkbox on the bottom left when updating a workflow. That means your users can change the Hotkeys and even the Keywords (though those are best done as Workflow Configuration) and their changes will remain on updates. That assumes you’re triggering updates by downloading the new version and opening it, if you’re e.g. directly overwriting the info.plist (not recommended), that’s another matter.

Link to comment
1 hour ago, vitor said:

Welcome @fixrepeating,

 

By default, workflow customisations are kept during updates. Notice the checkbox on the bottom left when updating a workflow. That means your users can change the Hotkeys and even the Keywords (though those are best done as Workflow Configuration) and their changes will remain on updates. That assumes you’re triggering updates by downloading the new version and opening it, if you’re e.g. directly overwriting the info.plist (not recommended), that’s another matter.


I’m distributing the workflow directly with a symlink so changes and updates are transparent (and require no end user work). 

Link to comment

In that case you need to avoid syncing the prefs.json or workflow configuration will be synced too. Assuming your sync is one directional (you send changes but don’t receive them), a way to avoid that is to have the defaults be what you personally use, so a prefs.json is not created.


Something like your first idea is the way to go. Take advantage of the External Trigger and Call External Trigger Output. You can even provide a template workflow with the valid Hotkey → Call External Trigger Output connections already in place. Package it up and bundle it in the workflow’s folder. You can then have a Keyword Input → Open File Action connection in the main workflow set to open the bundled workflow. That way users can easily install it, and if you ever update it they just have to rerun the same command to install the new version, keeping the already set up Keywords.

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