Skip to main content

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:

  1. Repeats an action 10 times
  2. Waits for a specific image to appear
  3. Clicks on that image

Breaking It Down:

  • The outer green block is the repeat block. It's set to run 10 times.
  • Inside the repeat block, there are two actions:
    1. wait image: This block waits for "your-image.jpg" to appear on the screen. It will wait for up to 5000 milliseconds (5 seconds).
    2. 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:

  1. Drag the repeat block from the Loops section on the left.
  2. Set the number of repetitions (in this case, 10).
  3. Add the wait image and click image blocks inside the repeat block.
  4. 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.