User Tools

Site Tools


action:For_Each

**This is an old revision of the document!**

For Each Action

The For Each action loops over a set of collections of items, setting a variable to each value and executing the contained actions.

Whenever you need to deal with a list of things (lines, files, volumes, numbers, etc), the For Each action is a good place to start.

How To Use

  1. Add the For Each Action, from the Control Flow Category, to your macro
  2. Enter a variable or select from the pop-up at the end of the For each text area.
    • This variable will contain each item in the Collection list as the For Each Action loops
    • This can be a new or existing variable, as your needs dictate
    • You can then use or process this item as needed
  3. Add a collection by clicking the green + button beside New Collection to select from a list of available collections. You can learn more about the available collections on the Collections page.
  4. When you choose a specific collection, further options may become available.
  5. Drag one or more actions into the No Action (which means no actions have been added yet) area.
    • These actions will operate on each item in the Collection that is stored in the Variable from Step #2

Examples

Example #1: Split text into lines or substrings

For a complete macro using this Action, see:
MACRO: [FILE] Process Lines in Text File

Example #2: Get Capture Group for Multiple Matches

See Regular Expressions (RegEx) Examples

See also


Actions

Triggers

Forum

action/For_Each.1467614749.txt.gz · Last modified: 2016/07/04 02:45 by alain