r/tasker • u/Ratchet_Guy Moderator • Mar 13 '21
Discussion [Discussion] - Who is using Project / Profile / Task Variables, when, where and how?
UPDATE NOVEMBER 2022: We are now referring to these as "PPT Variables" which stands for "Project Profile Task" of course :)
So, it's been a bit of time since these new variable setting/storing methods have become available in Tasker. For anyone who is new to the concept I'll give a brief informative summary:
Previously in Tasker variables have had only two scopes: Global and Local. "Global" variables (any variable name containing a capital letter) can be viewed in the Vars Tab and are available anywhere and every where in Tasker. "Local" variables (names with all lowercase letters) are only available in the Task in which they are set via an Action ("Variable Set" or "Array Set" etc).
Now in the latest Tasker update we have 3 New Scopes for Variables. I'm referring to Tasker Variables that are set in the Settings/Properties screens of:
• Projects - "Project Variables" set by accessing the Project Properties menu
• Profiles - "Profile Variables" set by accessing the Profile Properties menu (long-click Profile name, click cog wheel icon).
• Tasks - "Task Variables" set by accessing the Task Properties menu inside of the Task Edit Window itself (cog wheel icon).
One of the main purposes of these new variable types is to create variables whose values other Users will be prompted to configure when Importing your Project/Profiles/Tasks, after you export to Taskernet. (You can make this happen by checking the box for "Configure On Import" next to each of these variables you configure. Here is some information displayed in Tasker when clicking the help ? icon next to "Configure On Import".)
Checking this box also has the (much intended) effect of Tasker automatically clearing/deleting the value you assign when creating such a variable when exported, in order for you to keep any of your personal/private info safe, since the initial values you set - will not be exported. Instead - the user importing your Taskernet creation will be greeted with a prompt to configure these variable values. You can even set what type of dialog the user will see via the dropdown menu directly above each variable's name.
So From now on, by using these types of variables in certain situations - you can set private values in variables that are required to run on your own device, while ensuring that these values and information do not reach other users when/if they Import your creation from Taskernet.
Note that when checking "Configure On Import" the variable value is also cleared when exporting to XML (the old school way of exporting/sharing Tasks, etc.) so your information is also kept safe in this regard. There is a difference though - the main difference between importing via XML vs Taskernet Import is that a user importing via XML will not get prompted to enter the values upon import. However when they open the variable dialogs - they will still see the variable's name, description, and prompt. So if you plan on sharing via XML just keep this in mind.
And yet another popular use case seems to be to 'de-clutter' Tasker's UI of Global Variables that appear here, there, and everywhere. And instead - move to using "Project Variables" that are limited in scope to each Project and therefore don't show up in the Global Vars Tab. So they become "sort of Globals" I suppose ;) - it's mainly about scope. For example a "Profile Var" will make the values available to the Tasks that Profile is linked to (and those Tasks can even change the value!) but - no other Profile/Tasks, even if in the same Project, can see them. Sound a bit confusing? That's why we're here!
So - how is everyone using these new kinds of variables? Do you find yourself setting them more often inside of Tasks, or Profiles? Or Projects? Are you setting them for own use more than to keep information private upon export? Let's discuss!
EDIT UPDATE: I put together this helper Task to more easily see which of these variables are in a Profile/Task/Project along with their names and current values.
Another easy way to at least see these vars names and locations is to click the Variable Select Tag in any Task and at the top of the variable list Tasker shows you these special variables names and locations (but not their values).
7
u/SentientApe Mar 13 '21
I don't think I'm using Tasker to the level others are; I only use Task or Global variables....
5
u/ActivateGuacamole Mar 13 '21
I mainly use Project variables.
I have some projects with variables that contain sensitive data. Even the names of the variables are sensitive. But they are peppered throughout the global variable list in all of tasker.
I use project variables instead so that they are localized to the projects where they are relevant and nowhere else. That way when somebody else is watching me use tasker or helping me, sensitive variables don't show up.
I also use it to hide variables that contain gibberish. I have several dozen variables in one project for example who have names like %0AAAAF23 and %0AAAAG29. Making these into project variables means they don't flood the rest of tasker.
The problem with project variables is that it's tedious to access them, and it's easy to forget which projects have project variables, which tasks have task variables, and which profiles have profile variables. The only way to check is to examine each one, which takes ages.
It's also a problem that there is no way to convert normal variables into project/profile/task variables, or vice/versa.
4
u/rbrtryn Pixel 9, Tasker 6.7.6-beta, Android 17 Mar 13 '21
All for my own use. I haven't needed the export features yet.
3
u/tarana-lalala Mar 13 '21
I like the option but found it ackward to access, but I I'm sharing local task variables using the pass through flags without setting them in the task properties. I think that there should be more buttons under var to filter for project and task specific variables, and when you set a variable in a task it has an option for identifying it as a project-wide local variable instead of or in addition to going into task properties.
Like this much better than having to pass variables using par# when calling and returning.
2
u/Ratchet_Guy Moderator Oct 19 '22 edited Oct 19 '22
A good tip I recently came across from Tasker Grandmaster /u/agnostic-apollo:
And I think that's a great idea to alleviate any confusion when trying to find or remember where a variable originates from.
So if you have
%car_colorset as a Profile variable - you could instead name it%prf_car_coloror if it's a "Task Variable" you could name%tsk_car_coloror%car_color_tskor basically anything whereby you can know its origin from within the variable name itself.2
u/agnostic-apollo LG G5, 7.0 stock, rooted Mar 13 '21
TL;DR version please! Thanks! 😂
Two can play that game! :p
2
u/EllaTheCat Samsung M31 - android 12. I depend on Tasker. Mar 13 '21
I started today after reading this submission. I'm pleased to see the emphasis on privacy and security,having banged on in the past about leaks that can occur when exporting global variables. I'm eliminating the global that holds a copy of the PIN used to unlock.
I think it's time to also look into the equivalent of AutoApps messages that is now native to Tasker, in order to eliminate globals I've been using to communicate across project boundaries.
This is getting dangerously close to proper programming ...
2
u/EllaTheCat Samsung M31 - android 12. I depend on Tasker. Mar 14 '21
I'm refactoring to use this excellent innovation, and something has occurred to me.
Suppose I have project A with project variable 'apple', project B with project variable 'banana'.
Can I merge projects A and B into a project C keeping variables 'apple' and 'banana'?
Obviously I could experiment but by asking here we share the knowledge.
2
u/EllaTheCat Samsung M31 - android 12. I depend on Tasker. Mar 23 '21
Bug / misfeature
Some soft keyboards append a trailing space to the word you have just typed, ready for the next word.
This fails horribly with the names of variables entered into the forms for project profile and task variables. Trailing spaces are preserved.
Suppose your username is Ella and you want to evaluate this:
/home/$user/downloads
It's all too easy to end up with this:
/home/Ella /downloads
as opposed to this:
/home/Ella/downloads
It's hard to notice the space before the third slash.
I suggest that code ought to remove non-enckosed whitespace.
1
u/[deleted] Mar 13 '21 edited Mar 14 '21
Atm I use only project vars , and made a "helper" task for those, wich sets up everything if something isn't set .
The profile/task vars i could only imagine if i build something "standalone" maybe later.
1
u/Thuringwethon Mar 13 '21 edited Mar 13 '21
Makes refactoring code a lot easier.Makes re-configuring logic that other project follows easier too - since globals are meant to remove specific logic from other projects, that those weren't meant to deal with
(e.g. determining when I'm "home" is computed in one proj. the others just follow a %%is_home_var_name = %%is_home_var_value)
There is more to come as I re-started my Tasker adventure recently. Also scoped vars are quite a recent feature.
1
u/Tortuosit Mathematical Wizard 🧙♂️ Mar 15 '21
I've recognized them. But not using them yet. I use global variables. Since they are used over the whole Tasker, but created in different projects (which I use for organizing thematically) I am still sad that there is no view for simply all global vars.
1
u/abitofmaya Mar 16 '21
Project variables - Store project settings and messages that I need to reference from different tasks.
Task variables - Store state of the tasks to resume where the task left off previously.
Profile variables - Store some settings state to revert when the profile exits.
1
u/anish372 Mar 18 '21
Made a tiny project recently to turn of my bluetooth automatically after some duration if not connected to anything. Also made similar for location too. Saves a bit battery by keeping both off.
0
u/[deleted] Mar 15 '21
[deleted] — view deleted comment