-- check at least 1 repeat if %1 < 1 then ColourNote ("white", "red", "Too few repeats specified (%1)") return end -- if -- check not more than 50 repeats if %1 > 50 then ColourNote ("white", "red", "Too many repeats specified (%1)") return end -- if -- execute (send to command processor) the command for i = 1, %1 do Execute "%2" end -- for loop