erusev Posted July 20, 2022 Share Posted July 20, 2022 (edited) I made a workflow that lets me publish the selected text as a GitHub gist. Here's how it works: I select the text I want to publish, I open Universal Actions, and I select Publish as Gist (my workflow). Now I'd like to add an extra step that asks for the name of the new gist. I imagine something similar to the built-in Email to... action which asks for the email of the recipient (see attached screenshot). Is this possible? Edited July 20, 2022 by erusev Link to comment
vitor Posted July 20, 2022 Share Posted July 20, 2022 Use an Argument and Variables Utility to store the output of the Universal Action to a variable, then use a Keyword Input to ask for more information (leave the Keyword itself empty). You can again save the output of that to another variable, or use it directly. Link to comment
erusev Posted August 6, 2022 Author Share Posted August 6, 2022 Worked 😊 Thanks for taking the time respond! Any tips on how to pass the 2 variables to an external script? I see how I can concatenate the 2 strings into a single string and pass that, but I'd like to pass them as 2 separate arguments (`$1` and `$2`). Link to comment
andy4222 Posted August 6, 2022 Share Posted August 6, 2022 (edited) 4 hours ago, erusev said: Any tips on how to pass the 2 variables to an external script? You can use Run Script and call your script like this: /usr/local/bin/node transformer.js "$operation" "$capturedString" "$userInput" "$userInputSeparator" Here, all these args are values that are set using Args utility. In your script, depending on the language, you can fetch these args. I think that is a useful workflow. Would be nice if you can share it with the community Edited August 6, 2022 by andy4222 Link to comment
erusev Posted August 8, 2022 Author Share Posted August 8, 2022 Thanks! > I think that is a useful workflow. Would be nice if you can share it with the community I'd love to, but it depends on GitHub's "gh" cli tool being installed. How should I address (or communicate) this in the shared workflow? Thanks again. Link to comment
vitor Posted August 8, 2022 Share Posted August 8, 2022 1 hour ago, erusev said: I'd love to, but it depends on GitHub's "gh" cli tool being installed. How should I address (or communicate) this in the shared workflow? Mention it in your Workflow’s About. Homebrew is a standard way of installing those tools and Alfred 5 takes the Homebrew install locations into consideration in PATH, so you only need to mention to users the need to install Homebrew plus run brew install gh Link to comment
erusev Posted August 11, 2022 Author Share Posted August 11, 2022 (edited) Thanks @vitor! Shouldn't the workflow handle the "no gh installed" scenario? Ex: show an error or a notification. Edited August 11, 2022 by erusev Link to comment
vitor Posted August 11, 2022 Share Posted August 11, 2022 An error will be shown in the debugger. If you want to do something extra, you can! Link to comment
luckman212 Posted August 12, 2022 Share Posted August 12, 2022 @erusev I'd like to see this workflow too, sounds useful ! Hope you decide to share it. Link to comment
erusev Posted August 14, 2022 Author Share Posted August 14, 2022 (edited) @vitor Any tips on what I can do to make it a little more user-friendly? Would it make sense to use a Post Notification object? @luckman212 Thanks, I'll post here when I release it. Edited August 14, 2022 by erusev Link to comment
vitor Posted August 16, 2022 Share Posted August 16, 2022 @erusev Maybe a Conditional Dialog instead, with one of the options linking to a page which explains how to install what’s missing. Link to comment
erusev Posted August 16, 2022 Author Share Posted August 16, 2022 @vitor That's perfect! Thanks 🙏 Link to comment
erusev Posted September 3, 2022 Author Share Posted September 3, 2022 Is it possible to make the Keyword Input required? That is, don't accept empty values. Link to comment
vitor Posted September 3, 2022 Share Posted September 3, 2022 It’s the dropdown right at the top. The default value is Argument Required. erusev 1 Link to comment
erusev Posted September 4, 2022 Author Share Posted September 4, 2022 Awesome! Finally, any chance it's possible to set a default value? Link to comment
Stephen_C Posted September 4, 2022 Share Posted September 4, 2022 You can do that in the workflow configuration. Take a look at this Alfred help page. Stephen erusev 1 Link to comment
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