Javascript var into iim var ?

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
Icereborn
Posts: 9
Joined: Thu Jun 17, 2010 5:58 pm

Javascript var into iim var ?

Post by Icereborn » Thu Jun 17, 2010 6:02 pm

How, in a JS code save a java var into iim var ?

this is my script:
for (i; i<658; i++)
{
>> want to save i as !VAR 1, how to ?
macro += "ADD !VAR1 1" + " \n "; >> don't work :/
macro += "TAB T=1" + " \n ";
macro += "URL GOTO=URL" + " \n ";
macro += "TAG POS={{!VAR1}} TYPE=A ATTR=TXT:'txt'" + "\n "; >> need !VAR1
macro += "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:id" + " \n ";
macro += "TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:form1 ATTR=ID:id" + " \n ";
macro += "TAG POS=1 TYPE=B ATTR=TXT:txt" + " \n ";
macro += "TAG POS=1 TYPE=A ATTR=TXT:max" + " \n ";
macro += "TAG POS=1 TYPE=INPUT:BUTTON ATTR=VALUE:add" + " \n ";
macro += "TAG POS=1 TYPE=INPUT:IMAGE ATTR=ID:btn_valid" + " \n ";
macro += "TAG POS=1 TYPE=INPUT:IMAGE ATTR=SRC:URL" + " \n ";
iret = iimPlay(macro)
}
Last edited by Icereborn on Thu Jun 17, 2010 7:07 pm, edited 1 time in total.
jfj3rd
Posts: 43
Joined: Thu Dec 17, 2009 5:23 pm
Location: Riverside CA
Contact:

Re: How to save a var ?

Post by jfj3rd » Thu Jun 17, 2010 6:26 pm

Not sure if this will help you at all but take a look at a thread I have open from awhile back. I run a VBS script that runs macro1.iim to scrape the data that the VBS script then turns into unique variables. Then the script runs macro2.iim using those new variables.

This is how I name and save the variable in the VBS file:

Code: Select all

iret = iim1.iimSet("-var_SITEID", SiteID)
This is how I end up calling it in the iMacro itself:

((!SITEID}}

The link to that thread by the way is: http://forum.imacros.net/viewtopic.php?f= ... 967#p29967
--

Warmest Wishes,

John F. Jones III
Icereborn
Posts: 9
Joined: Thu Jun 17, 2010 5:58 pm

Re: How to save a var ?

Post by Icereborn » Thu Jun 17, 2010 6:55 pm

i need the answer for javascript, sorry, it don't help :/ (tryied it for test)
billbell52
Posts: 125
Joined: Tue Mar 23, 2010 8:45 pm

Re: Javascript var into iim var ?

Post by billbell52 » Thu Jun 17, 2010 7:49 pm

It should be {{SITEID}} not {{!SITEID}}.
Icereborn
Posts: 9
Joined: Thu Jun 17, 2010 5:58 pm

Re: Javascript var into iim var ?

Post by Icereborn » Fri Jun 18, 2010 4:25 am

i found it with the "var = iimSet("var1", i)"


thx for help :)
Post Reply