[Solved] Is there a guide on how to use these variables?

Florian

New member
I discovered this variable in a template: {lv=messages[{lv=i}]}. I understand that it takes the message from the messages variable with the number fron variable i. But where can I get more infos about these? I want to learn more.
 

hsurB

Well-known member
You could start with checking macrodroid's wiki and videos about array/dictionary variables.


Basically you can use integer variable +1 each time macro is fired.
And use that variable when defining key of array/dictionary to store something in next key every time.
Lets say notification received - integer variable +1 - set variable - array - key (integer variable from 2nd step - save notification text.
This way you will save each notification received in an array with keys being 1,2,3,4,...,11,12....

There is also useful action called iterate dictionary/array.
Its basically a loop that goes through each element of array/dictionary where iterator index is a key and iterator's value is what is saved under a key.
Lets say you have an array with links to youtube videos, you could use this loop as shown on screenshots to open all videos from an array - starting with the first one, waiting 3s to open the second one, waiting 3s and then opening 3rd video and so on...
 

Attachments

  • Screenshot_20231128_083405_MacroDroid.png
    Screenshot_20231128_083405_MacroDroid.png
    151.5 KB · Views: 18
  • Screenshot_20231128_083412_MacroDroid.png
    Screenshot_20231128_083412_MacroDroid.png
    297.2 KB · Views: 18
Last edited:
Top