For each and search and replacing lines of text in file

Basically it goes like this:

  • The action itinerates through all the lines of a given text file / variable / clipboard.
  • The current line is written to the “For each” variable; vtest in your macro.
  • With the sub-actions you add under “execute the following actions” you can do something on each itineration. Using the vtest variable in the sub-actions you can access the content of the current line.

Some use-cases:

  • You have a file/variable where each line is the path to an app or file. With the appropriate action you could for example open, read, delete, etc. each app/file.
  • You want to extract certain lines from a file/variable.
  • You want to count lines.

Given the paucity (ie complete absence as far as I am aware) practical examples of how For Each The Lines in works

Well, there is…

3 Likes