WinAutomation - windows automation software with macro recorder

      Manipulate every item of a list

      Sometimes, you may want to repeat one or more actions, for every item contained in a list. Either you want to use every item of an Excel row, or every line of a text file, you will have to deal with lists. In order to use every item of a specific list for a predefined set of actions, you will have to use a “For Each” loop (”For Each” action under “Loops” category).

      A “For Each” loop, iterates through every item of a list and stores the current item in a variable. This kind of loop is extremely useful when you do not know or you do not need to know the number of the iterations that will be needed, but you do want to iterate through every item of a list and use each one of them in an action (or a series of actions).

      Example:
      You may want to retrieve the filenames of every .mp3 file in your D:\ disk.  In this case, your job should look like this:
      1)  Get Files in Folder (D:\ , including subfolders) and store them in %MyMp3Files%
      2) For Each (item contained in %MyMp3Files% and store current item in %CurrentMp3%)
      3) Write text to file (append to C:\MyMp3Files.txt): %CurrentMp3.Name%
      4) End Loop

      AttachmentSize
      RetrieveMP3FileList.waj14 KB
      Your rating: None Average: 5 (1 vote)

      Comments:

      Post new comment

      The content of this field is kept private and will not be shown publicly.
      • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p>
      • Lines and paragraphs break automatically.
      • Web page addresses and e-mail addresses turn into links automatically.
      • You may quote other posts using [quote] tags.

      CAPTCHA
      This question is for testing whether you are a human visitor and to prevent automated spam submissions.



      Featured Clients