Jump to content

Using {const:} to keep workflow details up to date in objects.


Recommended Posts

You may already know that you can use {var:} to create user-configurable keywords, which makes workflows more convenient for users. But did you know you can use {const:} to make workflows more convenient for yourself?


Alfred sets a number of alfred_ environment variables with useful information. alfred_workflow_cache and alfred_workflow_data are particularly relevant in scripts but you can access the information in objects too via the {const:} pattern.


It’s common that in workflows which use a main Keyword / Script Filter as the entry point, I’ll have its title and subtitle match the name and description of the workflow. While workflow names seldom change, sometimes descriptions need a little tweak. If you’re copying the information back and forth, you may forget to update relevant workflow objects to match the new wording. Unless, that is, you use {const:alfred_workflow_name} and {const:alfred_workflow_description}, ensuring the information is kept in sync.

image.thumb.png.1dfae9ff550f543a0299eb686c1680da.png

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