简体   繁体   English

每次在iMacros上循环时,如何在变量上加1?

[英]How to add 1 number to variable each time it loops on iMacros?

I'm using firefox iMacros addons for an automation. 我正在使用firefox iMacros插件进行自动化。 I got stuck at one point. 我被困在某一点。 When I execute the following code, it works! 当我执行以下代码时,它起作用了! But, I want to increase one variable named CONTENT each time. 但是,我想每次增加一个名为CONTENT的变量。 Like, in this script its executed for account no- 001 . 就像,在此脚本中,其针对帐户编号001执行。

Now, I want to loop with this script with increase of the CONTENT no. 现在,我想通过增加内容编号来循环使用此脚本。 I mean, after first time execution it will execute for CONTENT no- 002 , then for 003 and so on. 我的意思是,第一次执行后,它将针对CONTENT no- 002执行,然后针对003执行 ,依此类推。 What change should I do with this script to make it works? 我应该对该脚本进行哪些更改以使其起作用?

VERSION BUILD=10022823
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://www.example.com
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:logInBankForm ATTR=NAME:userID CONTENT=myID
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:logInBankForm ATTR=NAME:password CONTENT=myPassword
TAG POS=1 TYPE=IMG FORM=NAME:logInBankForm ATTR=SRC:http://example.com/pages/login.jpg
TAG POS=1 TYPE=IMG FORM=NAME:logInBankForm ATTR=ID:join103
TAG POS=1 TYPE=A FORM=NAME:logInBankForm ATTR=TXT:Transaction<SP>Profile
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:accountNo CONTENT=001
DS CMD=KEY X=0 Y=0 CONTENT={ENTER}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[0].totalTransactionPerDay CONTENT=5
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[0].totalAmountPerDay CONTENT=300000
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[0].totalTransactionPerMonth CONTENT=20
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[0].totalAmountPerMonth CONTENT=1000000
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[0].maxAmountPerTransaction CONTENT=200000
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[1].totalTransactionPerDay CONTENT=4
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[1].totalAmountPerDay CONTENT=300000
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[1].totalTransactionPerMonth CONTENT=15
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[1].totalAmountPerMonth CONTENT=1000000
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:indexProfileList[1].maxAmountPerTransaction CONTENT=200000
TAG POS=1 TYPE=FONT FORM=NAME:customerTransactionProfileForm ATTR=TXT:Execute

If a more universal solution is needed, you may try to change these two lines 如果需要更通用的解决方案,则可以尝试更改这两行

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:accountNo CONTENT=001
DS CMD=KEY X=0 Y=0 CONTENT={ENTER}

for 对于

SET !LOOP 1
SET accNo EVAL("('00' + {{!LOOP}}).slice(-3);")
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:accountNo CONTENT={{accNo}}
SET !ERRORIGNORE YES
DS CMD=KEY X=0 Y=0 CONTENT={ENTER}
EVENT TYPE=KEYPRESS SELECTOR=* KEY=13
WAIT SECONDS=6
SET !TIMEOUT_STEP 0

Old info. 旧信息。
Replace the line 更换线

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:accountNo CONTENT=001

with

SET !LOOP 1
SET accNo EVAL("('00' + {{!LOOP}}).slice(-3);")
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:customerTransactionProfileForm ATTR=NAME:accountNo CONTENT={{accNo}}

and play the whole macro in loop mode. 并在循环模式下播放整个宏。


BTW, you provided a code that works only in 'iMacros Browser', but not in 'iMacros' for Firefox. 顺便说一句,您提供的代码仅适用于“ iMacros Browser”,不适用于Firefox的“ iMacros”。

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

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