Jump to content

Is there a way to notify user to do some config just after the workflow was installed.


Recommended Posts

Details:

I'm developing a workflow which need a API_TOKEN to get data from a third-party website. 

What I want is give  an obvious notification (something like a dialog with a edittext in it) to the user, Let them enter the API_TOKEN in the dialog directly.

Is it possiable?

 

Sorry for my poor english skill! Hope you guys can got it!

 

Thanks in advance!

Link to comment

 

@ghui if you fill in the "About this Workflow" field under the [x] button to the top right of the workflow config, this is shown when the user installs the workflow. If you set the token as a variable in there, this is a good place for the user to set it too, then you can use that variable in your workflow :)

 

Cheers,

Andrew

Link to comment

@Andrew Thanks firstly,  The panel 'About this Workflow' showed when a workflow installed, But the 'Workflow Environment Variables' panel doesn't show.

I guess you mean set the token to the 'workflow environment variables' panel.

For more detail see the image, please

detail.png

detail2.png

Edited by ghui
more details
Link to comment

@ghui there is no way at this point to automatically show variables which need filling. The best thing to do for now is put some info in the "About this Workflow" section to say something along the lines of: "Set your API token in the variables panel".

 

I'll add a note to have a think about "required variables" for a future release of Alfred :)

 

Cheers,

Andrew

Link to comment

Well,

I think there could be a solution, but a little tricky to implement.

Using Applescript you could be able to display a dialog to the user and accept an input, then you could use the value to override the workflow environment variables.

 

obviously that will not work at installation time, but at the first launch, after you control the missing value

 

here you have a startup:

place on your workflow an osascript AS object, and paste this code:

 

on run argv
set theName to the text returned of (display dialog "What is your name?" default answer "")
end run

 

running it you will have a dialog appear, asking the user for input

 

if you link a 'post notification' object after that, you will se what the user has entered (I think the AS output is simply the last variable set, theName in this case)

 

I'm quite sure that also in Javascript, if used as OSAscript, you can display a dialog, if you feel more comfortable with javascript...

 

once obtained the value, you should be able to set it as workflow variable:

 

https://www.alfredapp.com/help/workflows/advanced/variables/

 

hope this helps a bit,

 

Giulio

 

 

Edited by juliosecco
Link to comment

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...