This is an automated archive made by the Lemmit Bot.

The original was posted on /r/tasker by /u/Ratchet_Guy on 2023-11-26 07:58:28.


 

Sometimes in Tasker you just want to set a whole bunch of variables and their values at one time in a very simple format.

 

Now yes I know there is the “Multiple Variable Set” Action, but - that sticks all the variable names in one text field, and all the related values in another field below it. That creates a number of issues both in quickly defining variables and in quickly changing them.

 

For example take this image of some color-related variable names and their related hex values. Let’s say you quickly want to change the “highlight” color value. Can you quickly/easily correlate its value/position in the bottom text field in that image?

 

Sometimes its much easier to have the name/value pairs on the same line like this or some other simple data like this. I may have posted this before somewhere but I figured I’d post it again here just in case. Thanks to some quick little javascript by /u/JustRollWithIt - variable name/value pairs can be quickly configured on the same line in the format shown in the images above:

 

varname=value
varname=value
varname=value
etc

 

So use just one “Variable Set” Action to put that data in a variable named %data then run the following Javascriptlet in the next Action. Don’t worry, the single Action of code is in the Taskernet Download.

 

Taskernet Download The Code/Example

 

And that’s it! You’ve got all the variables you want quickly assigned with their values on single lines. Now, I’m sure there’s a thousand technical quirks with certain characters in the data and all kinds of little stuff, but this is made just to be a quick/simple way to assign variables using basic simple data

 

Hope this helps some folks out!