Jump to content

How to make a universal action that asks for extra input


Recommended Posts

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?

 

image.png

Edited by erusev
Link to comment
  • erusev changed the title to How to make a universal action that asks for extra input
  • 3 weeks later...

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
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 by andy4222
Link to comment

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
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
  • 3 weeks later...

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
×
×
  • Create New...