dim ret, i;
for (i = 1; i <= 999999; i++)
iimPlay("macro1")
ret = iimPlay("CODE:SEARCH SOURCE=TXT:"dog" IGNORE_CASE=YES")
if ret == 1 then // Text was found
ret = iimPlay("macro2")
else if (ret != -101) then
ret = iimPlay("macro1")
end for
if (ret == -101) then break
next
I suggest pasting this in to your dev tools, then correcting any syntax errors it highlights. I don't know VBSCript, but this should get you started.