简体   繁体   中英

imacros javascript datasource line loop

I've created this macro script in .js. But there's a problem with looping. Attached the script here : http://justpaste.it/js5j

You can see there're 2 datasources.

Sites.csv DB.csv

What I want to do is, Go to COL1 in sites csv and loop the db.csv 10 times. And then go to COL2 in sites.csv

DB.csv works fine, but in the second main loop, it doesn't go to COL2. In other words DATASOURCE Line is always 1

How can I make this work. Tires alot, But still couldn't figure it out. Need you guys help. Thank you.

What's the problem? Save !COL1 from DS one to var:

SET !DATASOURCE Sites.csv
SET !DATASOURCE_LINE wt_n
set var1 {{!COL1}}
SET !DATASOURCE DB.csv
SET !DATASOURCE_LINE wt_i
set var2 {{!COL1}}

URL GOTO={{var1}}
do something with {{var2}}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM