iMacro:测试结果 URL

iMacro: test resulting URL

使用 iMacro(chrome 扩展),我想自动执行网站上的操作:

  1. 勾选复选框(条件)

  2. 点击按钮(提交)

  3. 然后将结果 url 与字符串

    进行比较

    if true ==> 从头开始​​重新启动脚本
    如果 false ==> 显示弹出消息(或任何其他提醒用户的消息)

我在记录步骤 1 和 2 后从这里开始,效果很好并且可以 运行 循环

VERSION BUILD=8350307 RECORDER=CR
URL GOTO=http://websitew.com/5421/0
REFRESH
TAG POS=1 TYPE=A ATTR=HREF:http://websitew.com/5421/0#
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:FormBookingCreate ATTR=ID:condition CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:FormBookingCreate ATTR=NAME:nextButton
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:FormBookingCreate ATTR=NAME:finishButton

此外,它不接受 if 语句,我不知道如何通过某种消息框或警报通知用户

SET current {{!URLCURRENT}}

#if current = "http://websitew.com/5421/0" then
MsgBox "OK!"
else
   """start from the beginning """

为 Chrome 'iMacros' 扩展试试这个解决方案:

' here your code with the 1st and 2nd steps '

SET S EVAL("('{{!URLCURRENT}}' == 'http://websitew.com/5421/0') ? 'alert(\"OK!\");' : 'undefined';")
URL GOTO=javascript:{{S}}

' uncomment the line below to stop your macro after a message box '
'SET E EVAL("('{{S}}' == 'undefined') ? '' : MacroError('STOP!');")