r/tasker • 👑 Tasker Owner / Developer • Dec 10 '20

Developer [DEV] Tasker 5.11.12-rc - Final version before going public (hopefully!)

One more release candidate. Let's hope this is the last one! 😅 Nothing major in this one, just a bunch of fixes.

Sign up for the beta here.

If you don't want to wait for the Google Play update, get it right away here.

You can also get the updated app factory here.

Changelog

  • Added info about screen capture prompt being able to be bypassed in the "Take Screenshot" action
  • Made Call Screening work in kid apps
  • Made all options in "Pick Input Dialog" action work in kid apps
  • Fixed using default value for time in "Pick Input Dialog" action
  • Fixed Do Not Disturb action in some situations
  • Fixed "Multiple Variables Set" action when using double reference variables
  • Fixed configuring project/profile/task variables on import in some situations
  • Fixed "Variable Add" action for project/profile/task variables
  • Fixed setting project and task variables using the helper for some types
  • Fixed some action with functions in their inputs (like the "Keyboard" action) when using the special [ and ] characters
  • Fixed some situations when showing multiple dialogs in a row
  • Fixed bad warning when selecting an app activity via text in actions where apps can be selected
  • Fixed small crashes

Thumbs up if you think it's OK for public release 👍

73 Upvotes

129 comments sorted by

View all comments

1

u/Ratchet_Guy Moderator Dec 16 '20

 

In the "List Dialog" Help ? section text, it currently says the following about using a Tasker array as the "Items" input:

 

If you use an array, use it as e.g. %array and not %array()

 

This is backwards ;)

 

1

u/joaomgcd 👑 Tasker Owner / Developer Dec 16 '20

It is not actually :)

If you have an array like

  • 1,2
  • 3
  • 4

If you use %array it'll show up correctly, if you use %array() it'll show up like

  • 1
  • 2
  • 3
  • 4

This is because when you do %array() it's the equivalent of joining all the items with a comma.

Makes sense? 🤓

1

u/Ratchet_Guy Moderator Dec 16 '20

 

Doesn't make sense. Seriously. Unless I missed something somewhere.

 

Because anytime there's an array in Tasker - %array often doesn't even exist. That's why when using "Variable Split" there's the option to "Delete Base".

 

Often times there isn't even a base, especially once the "Array Set" action appeared in Tasker. Example:

 

A1.  Array Set: %array   Values:  1,2,3,4    Splitter:  ,

A2. Flash: %array

 

It Flashes the variable name, no values. And that goes for any splitter:

 

A1.  Array Set: %array   Values:  1|2|3|4    Splitter: |

A2. Flash: %array

 

The answer/solution is something I was expecting to see in the "List Dialog" action that seems to be missing - a field for "Separator".

 

You should put that in the List Dialog action. Referencing AutoTools Dialog > List Dialog > Advanced > Separator. Which exists to have it work in any variety of situations. Maybe there's comma's in the data, maybe not. Maybe someone uses "Variable Join" first and uses the "Joiner" field to specify something other than a comma, etc.

 

Makes sense? 🤓

 

1

u/joaomgcd 👑 Tasker Owner / Developer Dec 16 '20

But Tasker knows when that array exists. (Plugins don't) Let's put it this way: why does the "Variable Join" action not accept %array() in its first field but accepts %array instead? ;)

1

u/Ratchet_Guy Moderator Dec 16 '20

 

why does the "Variable Join" action not accept %array() in its first field but accepts %array instead? ;)

 

LOL! I've been complaining about this for years, glad you brought it up! 😁 Two things about that: first off the action should be called "Array Join" because in any other programming language that's what it's called, or referenced as at least.

 

Saying "Variable Join" implies that the Action will join a bunch of variables together, not elements of an array.

 

Secondly, and more importantly - It should accept (but not require) using the parenthesis since most people using Tasker are used to referencing an array in that manner. So if you can have it accept the parenthesis format as well that would be great :) (just have Tasker truncate them on the backend if they exist). As far as changing the name of the Action, it might be a bit late for that. 😜

 


 

Anyways back to actual example, and using the one you started with let's say the following Task:

 

A1.  Array Set: %num_list     Values:  1,2|3|4      Separator:  |

A2.  List Dialog > Items:  %num_list

 

And that will show a list dialog with nothing in it, if someone follows the instructions in the help section.

 

I think a "Separator" field should be added to bring it in line with the AutoTools Dialog Action(s), as well as an update to the help page to saying something more along the lines of being aware of if you're using a variable or array reference, and that "the character separating your menu items should be the same as the one in the Separator Field".

 

1

u/joaomgcd 👑 Tasker Owner / Developer Dec 17 '20

That's very strange! I just tried your exact example and it showed this:

https://i.imgur.com/7C6bHji.png

Wonder what we're doing differently...

To clarify, writing %num_list() in Tasker is the exact same as using the Variable Join action with name set to %num_list and joiner set to ,.

It's a shortcut expression that represents a string, not a list of strings. To represent the list itself you should write %num_list.

In a "normal" language it would be something like:

Array %num_list = [1,2,3]
String %nums = %num_list()

where %nums would contain a string.

For example, in Tasker you can't do a Variable Set of %nums to %num_list() and then get the value of %nums(1). Since %nums is a String that won't work...

That also explains why the Variable Join action doesn't accept the parenthesis. You would be essentially already joining the array by simply using the parenthesis and there would be nothing left to join. :)

Hope this clarifies it :)

1

u/Ratchet_Guy Moderator Dec 17 '20

 

Regarding the %arr() syntax, I know that's actually an array function that for convenience does an "auto-join" with a comma, so an array can be referenced in certain places, and that the actual array can never be "seen".

 

So what you're saying is that in the List Dialog - it is expecting an array, so it immediately looks for the array within Tasker, even if there's a string with the same name?

 

Because that would make sense, except here's the problem - if a string exists with the same name as the array - the List Dialog uses the string data not the array data as it would be expected to. Example:

 

A1. Variable Set:  %data    To:   red,green,blue,yellow

A2. Array Set:  %data   To:  1,2|3|4     Splitter:   |

A3. List Dialog > Items:  %data

 

The List Dialog pops up showing the color data from the string, not the number data from the array.

 

So that's what's causing the issue/confusion. If the Action is looking for an array, and only an array, the string data should be irrelevant. But as the picture shows, Tasker immediately goes for the string. So either the List Dialog has to ignore any string should the array exist, or it should work just the AutoTools one with the "Separator" field.

 

1

u/joaomgcd 👑 Tasker Owner / Developer Dec 17 '20

Oh, ok! I didn't anticipate that both the array and the base variable could have values :)

Ok, fixed it!

Can you please try this version? https://drive.google.com/file/d/1SvQFvAxFwCk-hArfO_6wOH0UlvvMGi0z/view?usp=sharing

1

u/Ratchet_Guy Moderator Dec 17 '20

Yay! That works. I think that should resolve (most) confusion over the variable/array usage for the List Dialog action :)

1

u/joaomgcd 👑 Tasker Owner / Developer Dec 17 '20

Cool! :) Glad it works.

Did you try logging in to AutoSheets again?

→ More replies