If Extract >= 600 then do this in imacro Error -
i writing macro code should work this:
- open link provided - no errors
- extract specified text - no errors
- remove unnecessary text, leaving number extract - no errors
- store number extract in variable "ff" - no errors
- make windows prompt , show number extracted - no errors
- text or check if extracted number greater or equal 600 - not working, see errors below
- make windows prompt , "greater 600" if condition met, if false "lower 600" - not working also
anyone point out , correct codes? i'm sorry , thank help.
tab t=1 set !extract_test_popup no url goto=https://www.instagram.com/user/ tag pos=1 type=a attr=href:/user/following/ extract=txt 'removes unnecessary text set ff eval("var s=\"{{!extract}}\"; s.replace(\"following\", \"\");") prompt {{ff}} set !var1 eval("var ff="{{!extract}}\"; if(ff==663) alert("greater 600"); else alert("lower 600");")
error encounter:
macrosyntaxerror: wrong format of set command, line 13 (error code: -910)
the problem set didn't explicitly set return value @ end, ended if-cases. per http://wiki.imacros.net/eval
you need explicitly return final value adding single statement end of javascript.
correct: set myval eval("var x = 1; x;") // myval = 1 incorrect: set myval eval("var x = 1;") // myval = null
if want output these texts depending on whether or not number bigger 600, do:
set !var1 eval("\"{{ff}}\" >= 600 ? \"greater 600\" : \"lower 600\";") prompt {{!var1}}
note extract not hold number string still containing following, use stripped ff variable input instead.
Comments
Post a Comment