I am using JavaScript for Automation in an Alfred workflow. I want to access the various environment variables that Alfred sets up. How do I access the environment variable like alfred_version?
How to access environment variables in Javascript for Automation on OS X
automationjavascript
Related Question
- MacOS – How to find a specific JavaScript identifier of a website
- AppleScript – How to set variables for an undetermined number of list items
- OSA Script failing for JavaScript All the Sudden
- In AppleScript or JavaScript how can you click menu item
- Get Value of Variable stops appending on last call & sets result to only that last variable
Best Answer
I do not have Alfred installed however I would think the following method should work.
For example, using the Script Editor set to JavaScript the following code returned my login name.
So, I'd assume that if "
alfred_version
" is the actual environment variable, then the following might work as well.