Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i use it in imacro, but i need some assistence

Thanks a lot
_______________________________________________________________________________________________


var ret;

for (var i = 1; i <= 999999; i++) {
iimPlay("macro1")

ret = iimPlay('CODE:SEARCH SOURCE=TXT:"dog" IGNORE_CASE=YES');

if (ret == 1) { // Text was found
ret = iimPlay("macro2");
}

else if (ret != -101) {
ret = iimPlay("macro1");
}

if (ret == -101) {
break;
}
Posted
Comments
Christian Graus 21-Jan-14 19:27pm    
What have you tried ? Where are you stuck ? This is simple code. Why do you need it in vbs ?
Immortalbard 21-Jan-14 19:36pm    
Because i ll use in Imacros, and Imacro not support .js
Christian Graus 21-Jan-14 19:41pm    
So where did the js code come from ?
Immortalbard 21-Jan-14 19:45pm    
Javascript is supported in imacro for firefox but does not work in browser imacro.
Sergey Alexandrovich Kryukov 21-Jan-14 19:45pm    
Why VBS, ever? This is not a standard language, unlike Javascript, Web browsers do not have to support it.
Perhaps it is for MS Scripting Host, but even then it's better to avoid it.
—SA

1 solution

VB
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.
 
Share this answer
 
Comments
Immortalbard 21-Jan-14 19:52pm    
Ok, i ll try do it.

Thanks a lot

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900