Jump to content

Script Environment Variables do not work anymore in Alfred 5 [Fixed Alfred 5.0.1 b2059 pre-release]


Recommended Posts

This time, I am referring not to the custom set script environment variables, but to the pre-defined ones here.

 

In Alfred 4, we could call them via `{var:alfred_workflow_bundleid}` for example, or in a JXA script via `$.getenv("alfred_workflow_bundleid")`. However, this does not work in Alfred 5, since the former now seems to require `{const:alfred_workflow_bundleid}` (can't find anymore where in the docs this is mentioned.). For scripts, I entirely do not know what the equivalent be, e.g. how to get the bundle-id (or other variables) via JXA in Alfred 5.

 

This has two problems:

1) how to access those variables/constants in Alfred 5?

2) is there an "easy" fix for this or do I have to go trough all my workflows and look for every instance of a script environment variable and change ir accordingly, to make it work in Alfred 5?

 

Link to comment
Share on other sites

4 hours ago, pseudometa said:

since the former now seems to require `{const:alfred_workflow_bundleid}`

 

That is correct, but do note those weren’t available with {var: before.

 

4 hours ago, pseudometa said:

(can't find anymore where in the docs this is mentioned.)

 

Good point. I’m looking into this.

 

4 hours ago, pseudometa said:

For scripts, I entirely do not know what the equivalent be

 

For scripts it works exactly as before. Though I have been able to reproduce your issue under specific circumstances. Toggling Alfred itself should fix it. I’ll raise a ticket internally.

 

Edited by vitor
Link to comment
Share on other sites

  • vitor changed the title to Script Environment Variables do not work anymore in Alfred 5 [Fixed Alfred 5.0.1 b2059 pre-release]

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
 Share

×
×
  • Create New...