SuperUserMan
SuperUserMan

Reputation: 37

IMACROS Error in code after converting iim code to javascript

have done this before but converting this part of IIM code to JAVSCRIPT, is giving me an error

IIM code (runs fine)

URL GOTO=abcDOTcom
EVENT TYPE=CLICK SELECTOR="#\\7 1RB7>DIV:type(1)" BUTTON=A

Converted to JAVSCRIPT Code

var macro;
macro =  "CODE:";
macro +=  "URL GOTO=abcDOTcom" + "\n"; 
macro +=  "EVENT TYPE=CLICK SELECTOR=\"#\\7 1RB7>DIV:type(1)\" BUTTON=A" + "\n"; 
iimPlay(macro)

i read that we have to comment out quotes with a \ before it. I did but still it isnt working

I feel the two \\ in the code before the 7 is an issue OR the SPACE after the 7 is an issue How do i make sure sure it runs fine in JAVASCRIPT

Some syntax issue i am pretty sure Thanks

Upvotes: 1

Views: 671

Answers (2)

Advena
Advena

Reputation: 2243

I imagine you used iMacros Code creator, which is outdated since 2013 (If I'm not wrong) Keep in mind when using Java Script and Strings to escape several characters.

You can also use an imacros java script converter which does the thing too.

Upvotes: 1

edinvnode
edinvnode

Reputation: 3547

var macro;
macro =  "CODE:";
macro +=  "URL GOTO=abcDOTcom" + "\n"; 
macro +=  'EVENT TYPE=CLICK SELECTOR="#\\7 1RB7>DIV:type(1)" BUTTON=A' + "\n"; 
iimPlay(macro)

With EVENT you have to use ' instead of " . And remove \ in front of ".

The code above works.

Upvotes: 0

Related Questions