Selection dialog variable question

I want to use selection dialog to trigger different macros that I have created to back up a specific app. If I understand correctly, I have to mess with variables to achieve that? I'd appreciate some guidance on how exactly I can use variables to trigger other macros, thanks!

Screenshot_2024-03-20-10-50-06-97_2e840d222d67ef3caca3a1c67d71d48f.jpg
 

Attachments

  • Screenshot_2024-03-20-10-50-16-95_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-03-20-10-50-16-95_2e840d222d67ef3caca3a1c67d71d48f.jpg
    444.3 KB · Views: 7
  • Screenshot_2024-03-20-10-50-24-10_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-03-20-10-50-24-10_2e840d222d67ef3caca3a1c67d71d48f.jpg
    411.4 KB · Views: 7
  • Screenshot_2024-03-20-10-50-34-72_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-03-20-10-50-34-72_2e840d222d67ef3caca3a1c67d71d48f.jpg
    335.7 KB · Views: 7
  • Back_up_Selection.macro
    1.9 KB · Views: 2

Dm114

Well-known member
I want to use selection dialog to trigger different macros that I have created to back up a specific app. If I understand correctly, I have to mess with variables to achieve that? I'd appreciate some guidance on how exactly I can use variables to trigger other macros, thanks!

View attachment 9004
You can use several methods:
1⁰) yours is OK. Then use an IF...ELSE IF clause based on "int-iterate" variable value
2⁰) store the info in a Dictionary with:
- keys = name of the macros to launch OR the text to display for each item
- values = text to display for each item OR name of the macros to launch
Then use a unique Run macro action based on selected item
 

Dm114

Well-known member
In scenario 2⁰) above, you can have a special routine for such or such selected item:
- IF int-iterate=3
- do whatever needed in this case
- ELSE IF int-iterate=another_specific_value
- do whatever needed in this case
- ELSE
- Run macro specified by selected item
- END IF
 
In scenario 2⁰) above, you can have a special routine for such or such selected item:
- IF int-iterate=3
- do whatever needed in this case
- ELSE IF int-iterate=another_specific_value
- do whatever needed in this case
- ELSE
- Run macro specified by selected item
- END IF
thank you SO MUCH!

For others who are still confused, I believe below are visual examples of what Dm114 are referring to.
 

Attachments

  • Screenshot_2024-03-20-11-52-32-22_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-03-20-11-52-32-22_2e840d222d67ef3caca3a1c67d71d48f.jpg
    551.9 KB · Views: 11
  • Screenshot_2024-03-20-11-52-38-99_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-03-20-11-52-38-99_2e840d222d67ef3caca3a1c67d71d48f.jpg
    534.9 KB · Views: 10

Dev777

Active member
If it's a long list of items you can put them in an array then use them directly in the selection dialogue
 

Attachments

  • Back_up_Selection.macro
    1.9 KB · Views: 1

Qarboz

Well-known member
Another, simpler but "scattershot" solution is to use a global variable in "Save selected index in numerical variable" in the Selection Dialog; then in the relevant macros enter the trigger "MacroDroid Variable Change" and entering the correct value.
 

Dm114

Well-known member
thank you SO MUCH!

For others who are still confused, I believe below are visual examples of what Dm114 are referring to.
Sorry but there is a big misunderstanding!

In your macro (method 1⁰) you only display a Floating text corresponding to the selected item but you do not launch the Run macro action...
 

Dm114

Well-known member
If it's a long list of items you can put them in an array then use them directly in the selection dialogue
Sorry but in this case an Array is not very useful as we need to have (macro_name, displayed_caption) couples. Only a Dictionary variable allows that.
 
Sorry but there is a big misunderstanding!

In your macro (method 1⁰) you only display a Floating text corresponding to the selected item but you do not launch the Run macro action...
Thanks for clarifying, I'm totally aware of that, the screenshot I show is just for demo purpose, and intent to help others. I was able to make it work with your idea from above. Thank you!
 
Top