How Can We Help?
< All Topics

Repeat commands skip or miss items

The Repeat, Repeat with Folder or Repeat with Variable command skips or misses items.

The Repeat, Repeat with Folder and/or Repeat with Variable command skips or misses items.

Depending upon the actions taken within a repeat loop, it can seem like items are being skipped when the real problem is that you are not allowing enough time for things to be processed. In this example, for each file in a specific folder, the macro displays the file in the Adobe Acrobat Reader and then closes Acrobat.

This macro fails to process all filenames:

Repeat with Folder
   Activate or Launch “Adobe Reader” OR “acrord32.exe”
   Delay 2.0 Seconds
   Text Type <ALT><F4>
Repeat End

However, if a delay is added to allow Acrobat enough time to shut down, all files are processed properly.

Repeat with Folder
   Activate or Launch “Adobe Reader” OR “acrord32.exe”
   Delay 2.0 Seconds
   Text Type <ALT><F4>
   Delay 5.0 Seconds
Repeat End

To determine that the Repeat command is not skipping items put a Text Box Display command inside the repeat loop to display the value of the repeat variable or use the Log Message command to log the value of the repeat variable.

– Applies to: Macro Express and Macro Express Pro