Examples
How to Use Loops in Android Macro
Repeat & Loop Example
Here's how you can use the repeat & loop in Android Macro:
What This Example Does:
This example demonstrates a basic loop structure that:
- Repeats an action 10 times
- Waits for a specific image to appear
- Clicks on that image
Breaking It Down:
- The outer green block is the
repeat
block. It's set to run10 times
. - Inside the repeat block, there are two actions:
wait image
: This block waits for "your-image.jpg" to appear on the screen. It will wait for up to 5000 milliseconds (5 seconds).click image
: Once the image appears (or after 5 seconds), this block clicks on "your-image.jpg".
Practical Uses:
This sequence will repeat 10 times. It's useful for tasks like:
- Repeatedly checking for and clicking on a button that appears periodically
- Automating a process that needs to be done multiple times
How to Use This Example:
To use this in your own macro:
- Drag the
repeat
block from theLoops
section on the left. - Set the number of repetitions (in this case, 10).
- Add the
wait image
andclick image
blocks inside the repeat block. - Customize the image name and wait time as needed.
Note: Remember to replace "your-image.jpg" with the actual image you want to interact with in your macro.
This simple example shows how you can easily create powerful, repetitive tasks in Android Macro without needing to write complex code.