Hi,
I’m trying to pass a value to a variable in iMacro from a VBS script. I’ve used the forum and tried all the examples, but probably doing something wrong. I’ve re-install with the 6.8 version and this did not help.
I’m trying to provide the variable “LOOPNUMBER” with a value. I’ve tested the value before the “SET !DATASOURCE_LINE {{LOOPNUMBER}}” line and the LOOPNUMBER is blank (“”). Which probably means that the value was not passed from the VBS script. I’ve also tried the variable in the iMacro script with and without the prefix character “!”, and still no luck.
Here are the scripts:
VBS
set iim1= CreateObject ("imacros")
i = iim1.iimInit ("-ie")
i = iim1.iimPlay("CUST.I.INIT")
dim intLoop
intLoop = 3
Do Until intLoop = 4
i = iim1.iimSET("-var_LOOPNUMBER", CStr(intLoop))
i = iim1.iimPLAY("CUST.I.50")
intLoop = intLoop + 1
Loop
iMacro
VERSION BUILD=6600525
TAB T=1
TAB CLOSEALLOTHERS
SET !FILESTOPWATCH CUST.I.RESULTS.csv
SET !DATASOURCE CUST.I.CSV
'Number of columns in the CSV file. This must be accurate!
SET !DATASOURCE_COLUMNS 23
'Start at line 2 to skip the header in the file
'Increase the current position in the file with each loop
SET !DATASOURCE_LINE {{LOOPNUMBER}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_Text;3;0;35;True;3;; CONTENT={{!COL6}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_Text;4;0;35;True;4;; CONTENT={{!COL7}}
…
I’ll really appreciate if someone could assist with a solution.
Regards,
JC