Run macro with variable for CONTENT field

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
nekkinisiwan
Posts: 1
Joined: Fri Aug 19, 2016 12:10 pm

Run macro with variable for CONTENT field

Post by nekkinisiwan » Fri Aug 19, 2016 12:32 pm

Hi everybody,

Just to say that I am descrovering Imarco and I am trying to do my first automation.
I recorded a macro and wanted to download files. For that, I need to pass a varibale to CONTENT which is a char and stored somewhere in txt or csv file.

Here is my sample code that i wanted to automate and do loop for each var passed to CONTENT. I heard about iimset but just wanted to get the solution as i think it's a simple operation.

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
URL GOTO=https://xxxx
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:fm1 ATTR=ID:password CONTENT=Azerty12301+
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:fm1 ATTR=ID:username CONTENT=e0380001
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:fm1 ATTR=NAME:submit
TAG POS=1 TYPE=TD ATTR=ID:iconmenuItemRechercher
TAG POS=1 TYPE=TD ATTR=ID:j_id260_lbl
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:j_id261 ATTR=ID:j_id261:recherche-PM-critere-reference CONTENT=FI-89024-000Z
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:j_id261 ATTR=ID:j_id261:pMSearchButtom
TAG POS=1 TYPE=A ATTR=ID:j_id448:searchPM:0:viewLocal
TAG POS=1 TYPE=DIV ATTR=ID:j_id95:panelDocs_header
ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}} WAIT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:j_id95 ATTR=NAME:j_id95:listDocument:0:j_id1043
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: Run macro with variable for CONTENT field

Post by iimfun » Mon Aug 22, 2016 6:56 am

Did you hear about the !DATASOURCE variable ( http://wiki.imacros.net/!DATASOURCE ) ?
chivracq
Posts: 8791
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Run macro with variable for CONTENT field

Post by chivracq » Mon Aug 22, 2016 7:19 am

nekkinisiwan wrote:Hi everybody,

Just to say that I am descrovering Imarco and I am trying to do my first automation.
I recorded a macro and wanted to download files. For that, I need to pass a varibale to CONTENT which is a char and stored somewhere in txt or csv file.

Here is my sample code that i wanted to automate and do loop for each var passed to CONTENT. I heard about iimset but just wanted to get the solution as i think it's a simple operation.

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
URL GOTO=https://xxxx
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:fm1 ATTR=ID:password CONTENT=Azerty12301+
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:fm1 ATTR=ID:username CONTENT=e0380001
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:fm1 ATTR=NAME:submit
TAG POS=1 TYPE=TD ATTR=ID:iconmenuItemRechercher
TAG POS=1 TYPE=TD ATTR=ID:j_id260_lbl
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:j_id261 ATTR=ID:j_id261:recherche-PM-critere-reference CONTENT=FI-89024-000Z
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:j_id261 ATTR=ID:j_id261:pMSearchButtom
TAG POS=1 TYPE=A ATTR=ID:j_id448:searchPM:0:viewLocal
TAG POS=1 TYPE=DIV ATTR=ID:j_id95:panelDocs_header
ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}} WAIT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:j_id95 ATTR=NAME:j_id95:listDocument:0:j_id1043
iimfun wrote:Did you hear about the !DATASOURCE variable ( http://wiki.imacros.net/!DATASOURCE ) ?
Ah-ah...!, very good...! And (F)CIM for me to react to any Thread anyway @OP...!

Hum..., + I have the "feeling" your Site contains several Dynamic ID's, not sure your Script will work after a Refresh/Reload...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply