Chris Messina Posted August 5, 2020 Share Posted August 5, 2020 Maybe I've just been filing a lot of bugs lately, but it would be handy if I could create auto-expansion snippets for well-known and environmental variables, in particular my OS version, i.e. "macOS 10.15.6". Dattwood 1 Link to comment Share on other sites More sharing options...
Dattwood Posted August 5, 2020 Share Posted August 5, 2020 I like this idea, if I understand it correctly (see the attached image... am I close?). aText, the text expander app, has an identical feature to this. In the meantime, perhaps you could create an "advanced snippet"? i.e., in a workflow, do Trigger -> Snippet, attach a Run Script action, insert something like echo -n $MY_VARIABLE ...and then attach a Copy to Clipboard ("expand immediately") as its output. Link to comment Share on other sites More sharing options...
vitor Posted August 5, 2020 Share Posted August 5, 2020 11 hours ago, chris said: auto-expansion snippets for well-known and environmental variables What do you mean by “well-known variables”? Environmental variables, by their own definition, exist within an environment, such as a specific session of your shell. To access them you have to define them, Alfred won’t automatically grab your shell’s startup files and interpret them—it doesn’t do that even for Workflows. 7 hours ago, Dattwood said: create an "advanced snippet"? i.e., in a workflow, do Trigger -> Snippet, attach a Run Script action This is the correct solution. The point of Workflows is that they expand Alfred’s native abilities, that’s the way to achieve what you want. Dattwood 1 Link to comment Share on other sites More sharing options...
Chris Messina Posted August 6, 2020 Author Share Posted August 6, 2020 On 8/4/2020 at 9:41 PM, Dattwood said: I like this idea, if I understand it correctly (see the attached image... am I close?). aText, the text expander app, has an identical feature to this. In the meantime, perhaps you could create an "advanced snippet"? i.e., in a workflow, do Trigger -> Snippet, attach a Run Script action, insert something like echo -n $MY_VARIABLE ...and then attach a Copy to Clipboard ("expand immediately") as its output. Yes, that's about right. I think I was unclear in my terminology... maybe I mean OS-level CONSTANTS rather than "environmental variables". I'm not a developer, but I tinker in code, so clearly I don't always know what I'm doing. I think @vitor is probably right in that I should setup a workflow for this.. it just feels less convenient to have to bounce back and forth between the snippet editor and workflows to manage/edit my snippets. 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