EVAL - Single/Double quote problem.

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
siniy
Posts: 118
Joined: Sat Nov 07, 2009 7:44 pm

EVAL - Single/Double quote problem.

Post by siniy » Tue Nov 08, 2011 9:39 am

Often extracted data comes with single or double quote. And script fails on EVAL command.
\"{{!EXTRACT}}\" works with single quote, but fails with double quote.
'{{!EXTRACT}}' fine with double quote and not with single quote.
What would be the universal solution? With this issue EVAL becomes useless, because I don't know what data may come in.

Example, Play(Loop) = 2

Code: Select all

VERSION BUILD=7401004 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO
SET !LOOP 1
URL GOTO=http://pastebin.com/Tv8PLRAA
TAG POS=1 TYPE=DIV ATTR=CLASS:de{{!LOOP}} EXTRACT=TXT
PROMPT EVAL("var s=\"{{!EXTRACT}}\"; s;")
Marcia, Tech Support

Re: EVAL - Single/Double quote problem.

Post by Marcia, Tech Support » Tue Nov 08, 2011 12:12 pm

Hello,

That's a good question.

I think we need to fix this in iMacros. Thanks for pointing out.
willjohnathan
Posts: 34
Joined: Thu Dec 01, 2011 9:17 pm

Re: EVAL - Single/Double quote problem.

Post by willjohnathan » Sun Feb 26, 2012 4:36 pm

I too would like a fix for this, pretty annoying.
Marcia, Tech Support

Re: EVAL - Single/Double quote problem.

Post by Marcia, Tech Support » Mon Feb 27, 2012 7:54 am

Hello,

This issue has been already solved in iMacros Browser and iMacros for Internet Explorer, since version 8.0.0. iMacros for Firefox will follow soon.

With this fix, double quotes in the variables are properly escaped in EVAL, as well as single quotes, if you use double quotes to delimit the variable. So, the example given by siniy works fine now.
coffee
Posts: 5
Joined: Sat Oct 15, 2011 7:05 pm

Re: EVAL - Single/Double quote problem.

Post by coffee » Fri Mar 16, 2012 10:09 pm

I also discovered this error, hope it will be fixed soon.
Post Reply