Variables set with iimSet lose values after next iimPlay?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
JohnHenson
Posts: 2
Joined: Thu Mar 20, 2008 3:52 pm

Variables set with iimSet lose values after next iimPlay?

Post by JohnHenson » Thu Mar 20, 2008 3:58 pm

I just installed the new update for iMacros for Firefox and noticed that now the variables that I set at the top of my .js file with iimSet("name","value"); seem to be reset after the first iimPlay("mymacro");

iimSet("name","value");
iimPlay("firstMacro"); // uses {{name}} as part of a text string, and "value" is inserted properly
iimPlay("secondMacro"); // also uses {{name}} as part of a text string, but instead of "value" being inserted i actually see "{{name}}" in the middle of the string.

Can anyone confirm that iimSet Variables lose their value after the first iimPlay in which they are used?

Thanks

John
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: Variables set with iimSet lose values after next iimPlay?

Post by Tech Support » Fri Mar 21, 2008 11:42 pm

Hi John,

Yes, they lose their values after each iimPlay. This is by design.

So this will work:

iimSet("name","value");
iimPlay("firstMacro"); // uses {{name}} as part of a text string, and "value" is inserted properly
iimSet("name","value");
iimPlay("secondMacro"); //

Please see http://wiki.imacros.net/iimSet%28%29 - the second example is based on your forum post :)

Ann
JohnHenson
Posts: 2
Joined: Thu Mar 20, 2008 3:52 pm

Re: Variables set with iimSet lose values after next iimPlay?

Post by JohnHenson » Tue Mar 25, 2008 9:23 pm

I don't understand what the benefit is to erasing those values. I've never heard of any language that erases variables after they've been accessed.

Or is it a technical limitation with your scripting engine? The previous version works as I would expect it to,though, I can set my 7-8 variable one time, and use them in all of my iimPlay() calls.

Oh well, it is very unfortunate.

Thanks for your answer.

John
Post Reply