[Feature] Loops in Macros

Hi all,

You can now use Loops inside macros.
Loops in macros allow you to automate repetitive tasks by repeatedly executing a block of actions. There are two primary types of loops that you can use in Distill macros: For Loops and While Loops

For loops are used to iterate over a set of values or elements. They are particularly useful when you need to perform an action a specific number of times or over an array of elements.

Looping over a range:
for-loop-block-range

Looping over selectors:
for-loop-block-selector

While Loops evaluate a condition before each iteration, and the loop continues until the condition is no longer true. For example, you might use a While Loop to continue clicking a “Load More” button until it no longer appears on a webpage.
while-loop-block

5 Likes