Repeat Counter

*Command deprecated - See note below

 

 

Script Editor > Expand Repeat Category > Repeat Counter

 

üWe recommend using the Store the Counter into a Variable option that is part of the Repeat Start command.

 

A repeat counter command can be placed inside a repeat loop. What this does is type via the keyboard the current count of the repeat loop. For example, if creating a macro that repeated 5 times and the only thing inside the repeat loop was the incremental counter, it would type out "12345" when the macro is run inside a program such as Notepad. 

 

The repeat counter can be especially useful for creating a unique name for each repeated loop. For example, while running a procedure multiple times, each result needs to be saved to a file name. Use the repeat loop and when the procedure saves the file name, add the incremental counter to the end of the file name. This provides a unique file name for each repetition.

 

If leading zeros are desired on counter values, then specify the "Counter Width". For example, to ensure that all values are at least 3 characters long, enter 3 for the width. This produces 001, 002, etc.

 

The syntax for the repeat command with a counter would be:

Repeat Start

  Repeat Counter: 3 digits wide

  Text Type: This is my macro text.

Repeat End

 

 


 

 

*Deprecated Commands

Some macro commands have been designated as deprecated. These commands may be infrequently used, use out of date terminology, or are no longer supported by newer versions of Windows. In some cases deprecated macro commands have been replaced by new ones.

 

Deprecated commands are still supported in existing macros for backward compatibility. However, they may be removed from Macro Express in the future. Where possible we recommend that you avoid the use of deprecated macro commands.

 

By default deprecated commands are not displayed or accessible from the list of commands in the Macro Express Editor. To allow adding deprecated commands to a macro enable the Show deprecated commands option found in Options, Preferences, General - Misc tab.