Jump to content
smerickson

Feature Request: Workflow "Variables" or "Settings"

Recommended Posts

Workflows are awesome!  I've made a number of workflows for myself recently.  I'd like to be able to share my workflows with other members of my team.  The main challenge to doing that is that many of my workflows are user-specific or account-specific or require some kind of settings value.  I would love for each user to be able to type in their own username or account name as a "variable" item in the workflow configuration screen.

 

My dream is that there would be a new type of "Workflow Input" called "Variable" or "Setting".  You could give it a name and then there would be a simple text box to let a novice user type in a value for the variable/setting.  I could then connect these input variables to my more complicated/generic scripts and have those scripts use the user-defined variables.  I imagine these would be available to my scripts the same way that the "{query}" variable can be used.

 

Just to clarify, these variables are not things that the user would type into the Alfred search box.  They are more like "settings" or "preferences" for my workflow.  They would be set up by users in the workflow configuration screen.  The values only needs to be configured once.

 

Thanks for considering.

Share this post


Link to post
Share on other sites

You can actually make this happen within the workflows themselves if you want.

 

If you want a computer account name to use, then just set the variable automatically via the bash command

echo $USER

Or, if you're looking for just a single variable to set, then create a quick applescript dialog box with a text field that would set the variable in a file in the workflow's permanent storage folder. Then you can just grab the contents of that file when you use the workflows. If you want, then you can make it so that the workflow always checks for the existence of this file, and, if it hasn't been created, then it pulls up the dialog box and exits the rest of the workflow (just a generic first-run script).

 

If you need just a couple of variables, then you could do the same with a couple of Applescript dialogs. See my Caffeinate Control workflow for an example of how to do these things.

 

If you need more variables, then you can set the first-run script to open a text file that has the parameters there for the user to fill in.

 

I've also created a way for a more advanced GUI for preferences that I'm using for an unreleased workflow to integrate with Packal.org. It's a bit heavier, but the GUI has the benefit of being written in php, so you needn't touch xcode. When I release that workflow, I'll also release a skeleton workflow that has the GUI framework in it for other people to use with a write-up of how to implement it.

Share this post


Link to post
Share on other sites

My dream is that there would be a new type of "Workflow Input" called "Variable" or "Setting".  You could give it a name and then there would be a simple text box to let a novice user type in a value for the variable/setting.  I could then connect these input variables to my more complicated/generic scripts and have those scripts use the user-defined variables.  I imagine these would be available to my scripts the same way that the "{query}" variable can be used.

 

 

 

Thanks for considering.

 

Yup, I think this one has been suggested a couple of times. 

 

Good idea.

 

I think integrating this into Alfred would make the whole process a lot more integrated. As a prompt is run then Alfred could shift his window contents off to the left, which would be a visual cue that you are still running the same workflow.

 

Aesthetically it would be much nicer.

Share this post


Link to post
Share on other sites

This would definitely be a handy feature. It's something workflow authors have to implement over and over again, and there is little consistency between workflows.

 

I'm all for features that save 100 workflow authors re-implementing the same basic, boilerplate functionality 500 times.

 

I would prefer a third tab in the workflow dialog you get when you double-click a workflow. If a workflow requires settings, this would automatically be shown on installation. If settings are invalid or incomplete, workflows could return an error to Alfred when run, which would lead to the settings sheet being shown (with the error message). Such things (required settings, whether to sync them or not) would be specified in the info.plist.

 

These settings could also be synced across machines along with the workflows (though this should be optional).

Edited by deanishe

Share this post


Link to post
Share on other sites

hey, i had the same idea several times, i also would like this feature.
the user could see a tab where he can configure his variables the first time he installs the workflow or when he double clicks on the workflow, maybe with form types (input field, textarea, select) and regex pattern check

Ncl:.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...