sindresorhus Posted July 3, 2016 Share Posted July 3, 2016 (edited) https://www.alfredapp.com/help/workflows/script-environment-variables/ Alfred already exposes info such as `alfred_workflow_name`, so it would make sense to also add `alfred_workflow_version` too. This can be useful to for debugging purposes and migration scripts. Edited July 3, 2016 by sindresorhus Link to comment Share on other sites More sharing options...
deanishe Posted July 9, 2016 Share Posted July 9, 2016 +1 Not much of a value proposition to having a version number in Alfred if it isn't available via environment variables, IMO. When Alfred added environment variables, it made it possible to write workflows without parsing info.plist (to figure out data and cache directories, for example). Utilising the Workflow Version set in Alfred means that you have to go back to parsing info.plist again, which is a significant regression in terms of complexity and performance overhead compared to what people are currently doing. Basically, writing workflows like it's 2013. It also means that, no, you can't forget about XML in Alfred 3 Link to comment Share on other sites More sharing options...
sindresorhus Posted July 13, 2016 Author Share Posted July 13, 2016 (edited) Yup, I ended up having to extract it out of the info.plist: https://github.com/sindresorhus/alfy/blob/42c59bc7d53f5d2fcbbfc1d45386bd1d99b2dea9/index.js#L29 Edited July 13, 2016 by sindresorhus Link to comment Share on other sites More sharing options...
Andrew Posted July 14, 2016 Share Posted July 14, 2016 This was an oversight and should have made it into v3.0. If you update to the Alfred 3.0.3 pre-release b692, this is now set as script environment variable 'alfred_workflow_version' Cheers, Andrew Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now