How can I create a macro that automatically clicks all buttons that have the same View Id?

hsurB

Well-known member
You could also try my other macro that I will attach here. It doesn't use dictionary so it should be quicker
I created normal loop there and used block until result with each ui interaction so as soon as it detects it can't click viewid with next value it breaks a loop.
Hopefully it works right away without a need to reconfigure anything.

You can leave disabled actions for now or delete them. I used macrodroid for testing
 

Attachments

  • Forum1.macro
    8.1 KB · Views: 7
  • Screenshot_20240219_232147_MacroDroid.jpg
    Screenshot_20240219_232147_MacroDroid.jpg
    737.9 KB · Views: 19

hsurB

Well-known member
In case you don't have the newest beta version and cant use endless loop just use fixed value and write like 99999 there.
Don't worry about the loop since it breaks as soon as it can't click the viewid so it shouldn't cause problems
 

Ayano

Member
In case you don't have the newest beta version and cant use endless loop just use fixed value and write like 99999 there.
Don't worry about the loop since it breaks as soon as it can't click the viewid so it shouldn't cause problems
i did and it works but the macro doesn't click all the buttons, only 8-12 of 30 and more so it's working but doesn't do all the work.

I want to thank you because we are Closer and closer to the solution, you are a truly genius hsurb
 

Ayano

Member
In case you don't have the newest beta version and cant use endless loop just use fixed value and write like 99999 there.
Don't worry about the loop since it breaks as soon as it can't click the viewid so it shouldn't cause problems
bro I almost did, I'm modifying the macro of dictionary, you have just to tell me how to filter the variable of dictionary by the text of string, the screen read have to look up only for banana text, nothing else.

I don't know if I've to do this by define manually key in the screen read action, or by using a regular expression in the if bro..

I just want to filter the string and store only strings that are banana.

all the others not.
 

hsurB

Well-known member
To filter dictionary you would have to use iterate action anyway. There is no way to use read screen content action and save only results that we want.
What if you tried to increase wait before next action from second macro (the one at the bottom) from 200ms to like 350?
I am not sure why would it miss some buttons along the way
 

Ayano

Member
To filter dictionary you would have to use iterate action anyway. There is no way to use read screen content action and save only results that we want.
What if you tried to increase wait before next action from second macro (the one at the bottom) from 200ms to like 350?
I am not sure why would it miss some buttons along the way
same problem, could it be because in the first Click I set id without the final $ and the second with $ but without *?
 

hsurB

Well-known member
You could try editing ui interaction (click) inside the loop and add * after {lv=counter}
Maybe some of these buttons have something in theirs viewids after the number

First button that appears shouldn't have $and number after in dictionary and second one should have $2 already so the rest should be fine
 

Ayano

Member
You could try editing ui interaction (click) inside the loop and add * after {lv=counter}
Maybe some of these buttons have something in theirs viewids after the number

First button that appears shouldn't have $and number after in dictionary and second one should have $2 already so the rest should be fine
I did and same problem, at maximum 7-8 clicks
 

hsurB

Well-known member
Try exporting macro that has dictionary with viewids saved (I hope it gets exported too) cause I'd like to see all viewids. You could also share logs after runing macro with normal loop. Maybe there is a hint why it stops that quickly - there might be random viewid between buttons that gets into way and breaks loop
 
Last edited:

Ayano

Member
Try exporting macro that has dictionary with viewids saved (I hope it gets exported too) cause I'd like to see all viewids. You could also share logs after runing macro with normal loop. Maybe there is a hint why it stops that quickly - there might be random viewid between buttons that gets into way and breaks loop
could I text you in direct message?
 

hsurB

Well-known member
After checking the app myself I am afraid its impossible to achieve it since macrodroid can recognize only few first buttons' viewids that are currently on screen. I can't find reliable way to scroll the page enough to go to the next set of buttons (then they are stored under the same viewids old one were earlier)

Also using ui interaction - identify in app wont work on any button.

Maybe its different for each book/file, not sure...
 
Last edited:
Top