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

  • vitor locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...