I am stucked here to get the if, else if, statements to work and ask for someone to help. I am using Javascript (scripting interface to iMacro) to accomplish the following executed from the javascript scripting interface. I have a .js file and a .iim file (recorded iMacro file). As you can see, I have big problems to get the if statement correct in the Javascript. Please help!
The end-to-end flow:
1) Check a website for a the word "maintenance".
a) If the word "maintenance" appears, iMacro will return a negative value (<0) and the macro shall start a .bat file
b) If the word doesnt appear, iMacro returns a positive value and the imacro shall continue
2) The imacro (.iim) continues and do an imagevalidation to compare image.
a) If no match on images, I macro returns a negative value (<0) and shall wait x seconds and restart the .iim file again (imacro1.iim)
b) If match on image , I macro returns a positive value (>0) and shall start another .iim-file (imacro2.iim)
My js-file:
' play macro
i = iim1.iimPlay("macro1.iim")
if i > 0 then
Set WshShell = WScript.CreateObject("WScript.Shell")
Command = "C:\start\start.bat"
WshShell.Run Command
else if
i = iim1.iimPlay ("CODE:IMAGESEARCH POS=1 IMAGE=20151228_1550.png CONFIDENCE=95" > 0)
WScript.Sleep 10000
i = iim1.iimPlay("macro1.iim")
else
i = iim1.iimPlay("macro2.iim")
end if
My .iim-file (macro1.iim)
URL GOTO=http://www.XXXXXX.com
WAIT SECONDS=5
TAG POS=1 TYPE=* ATTR=TXT:*maintenance* CONTENT=EVENT:FAIL_IF_FOUND
IMAGESEARCH POS=1 IMAGE=20151228_1550.png CONFIDENCE=95
Aucun commentaire:
Enregistrer un commentaire