Example-ErrorLevel

From iMacros

Jump to: navigation, search

This example demonstrates using batch files with error checking.

echo off
echo Example iMacros Batch File
REM Tip: You may have to adjust the path names to YOUR installation directory of iMacros

REM Note: The "-loop <x> " command runs the macro <x> times in a loop. 
REM This is the same as pressing the LOOP button in the IM browser.

"C:\Program Files\iMacros\imacros.exe" -macro Demo-FillForm -loop 3

REM The batch variable %errorlevel% is automatically set by "imacros.exe" upon exit

if %errorlevel% == 1 goto ok
if NOT %errorlevel% == 1 goto error

:ok
echo Macro completed succesfully!
goto end

:error
echo Error encountered during replay.
echo Errorcode=%errorlevel% 
echo Please see http://www.iopus.com/iim/support/error-codes.htm
echo for a detailed description of error codes.

:end
pause