PDA

View Full Version : How do we instruct jscript to continue even if there is an open dialog box?



webcan
10-10-2015, 09:20 PM
HI! I have a macro that uploads files to a site and when uploading it opens up a "Upload file" dialog box. However after the upload this box stays open!

I have 3 macros being called by a Jsscript and when it reaches the end of the macro it Haults until I hit the close window on the open ( upload window ) dialog window.

So how do I instruct jsscript ( If possible ) to continue with this open window?

Thanks in advance :)

--------------------code below for both IMacro and Jsscript----------------

Here is an example of 1 of the macros the Js script is calling..( I shortened it a bit and removed unnecessary stuff )
---------------------Macro 1 -----------------------

VERSION BUILD=8940826 RECORDER=FX
TAB T=1
URL GOTO=http://www.kijiji.ca/p-select-category.html?categoryId=37
WAIT SECONDS=1
TAG POS=1 TYPE=A ATTR=ID:PostAdLink
WAIT SECONDS=1
TAG POS=1 TYPE=A ATTR=ID:CategoryId37
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:PostAdMainForm ATTR=ID:postad-title CONTENT=<SP>XXXXXXXXXXXXXXXXX
TAG POS=1 TYPE=SELECT FORM=ACTION:/p-submit-ad.html ATTR=NAME:locationLevel0 CONTENT=%1700281
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON FORM=ACTION:/p-submit-ad.html ATTR=TXT:Select<SP>Images
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/p-submit-ad.html ATTR=* CONTENT=C:\Users\XXX<SP>Drive\fff<SP>XXX<SP>Docs\Advertizing\RH<SP>XXX\yyy<SP>XXX\1.jpg
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON FORM=ACTION:/p-submit-ad.html ATTR=TXT:Select<SP>Images
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/p-submit-ad.html ATTR=* CONTENT=C:\Users\XXX<SP>Drive\fff<SP>XXX<SP>Docs\XXX\RH<SP>XXX\yyy<SP>XXX\2.JPG
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON FORM=ID:PostAdMainForm ATTR=NAME:saveAndCheckout
----------------------------end of Macro 1 ------------------------------

------------Js File ------------------------

var i, retcode;
var report;
var macrolist = new Array();

macrolist.push("Macro1.iim")
macrolist.push("Macro2.iim")
macrolist.push("Macro3.iim")

report = "Test report\n\n";

for (i = 0; i < macrolist.length; i++) {
iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist[i]);
retcode = iimPlay(macrolist[i]);
report += macrolist[i];
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
s = iimGetLastExtract(1);
/* if ( s != "" ) report += ", Extract: "+s; */
}
report += "\n";
}
alert ( report );