简体   繁体   English

Imacros评估功能需要帮助

[英]Imacros Eval function Small Help Required

Hello Please Help Me with this 你好,请帮我

this is middlle snippet of the whole script ( numbering and asterisk only for reference ) 这是整个脚本的中段代码(编号和星号仅供参考)

1) ONDOWNLOAD FOLDER=C:\MyFiles\ FILE=captcha.jpg WAIT=YES
2) TAG POS=1 TYPE=IMG ATTR = *******
3) *****
4) ****
5) ***
6) SET !VAR1 {{!EXTRACT}}
7) TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:CAPTCHABox ATTR=ID:tokentext CONTENT= {{!EXTRACT}}
8 TAG POS=1 TYPE=BUTTON ATTR=ID:continue

Then after step 8 然后在步骤8之后

I want it to check for this element 我希望它检查此元素

TAG POS=1 TYPE=H1 ATTR=TXT:Check

if it exists then move forward to the next lines of the code ( step 9, 10 etc ) else if it does not exists or gives an error then i want it to repeat steps from 1 to 8 and then check again, if element is absent again repeat 1-8 else move forward to step 9 and so on.. 如果存在,则前进到代码的下一行(步骤9、10等),否则,如果它不存在或给出错误,则我希望它重复从1到8的步骤,然后再次检查,如果元素不存在再次重复1-8,否则前进到步骤9,依此类推。

i think EVAL function can be used in it , can you please provide the correct code ? 我认为可以在其中使用EVAL函数,请提供正确的代码? i have tried a lot of times but failed 我已经尝试了很多次但都失败了

Ps - I am already looping whole script from .vbs if possible please provide code that can be used in .iim only ps-如果可能的话,我已经在.vbs中循环了整个脚本,请提供仅可在.iim中使用的代码

Please Reply 请回复

thank you very very much 非常非常感谢你

Edit - this is my .vbs code 编辑-这是我的.vbs代码

Option Explicit

Dim iim1, i, s , shell
dim iret
dim myname, mypath
dim pos


'initialize iMacros instance
set iim1= CreateObject ("iMacros")



'i = iim1.iimOpen ("-fx", false) 'Use open Firefox instance if available
i = iim1.iimOpen ("-fx", true) 'Always open new instance

pos = 2

Do while pos < 5



iret = iim1.iimSet("loopVar",Cstr(pos))
iret = iim1.iimPlay("ecc2.iim")


set shell=createobject("wscript.shell")
shell.Run "%comspec% /c C:\Users\SDFL\Desktop\dc1.bat"

pos = pos + 1
loop

Please tell me how i can do this without disturbing the main loop and bat file ? 请告诉我如何在不干扰主循环和bat文件的情况下执行此操作?

you can't do it in pure IIM script, since it does not have ability to loop code inside the code. 您不能在纯IIM脚本中执行此操作,因为它不具有在代码内部循环代码的功能。 you need to manage looping and verification in javascript or main vbs code, but not with EVAL inside IIM code 您需要使用javascript或主要vbs代码管理循环和验证,但无需使用IIM代码中的EVAL进行管理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM