Imacros not closing file Upload window after upload.

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
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

Imacros not closing file Upload window after upload.

Post by webcan » Sat Oct 10, 2015 11:05 am

HI! I am sorry if I am posting this again under a different title as the last title did not exactly reflect the issue directly and also this is a more fitting sub-forum as if pertains to FF Imacro.
-----------------------------------------------------------------------------------------------------------------------------------------
I have a macro that uploads files to a site ( code below ) all is good as far as the upload goes but it does not close the "upload dialog window" which in turn creates issues when I use Jscript.

So If I use the "Play loop" with the code below with a macro ( in Imacros for FF) it will upload all files in the macro but it will leave 1 open window per macro call so if I loop the script 25 times then I get 25 open upload file windows.

Now this is creating issues when I use jsscript to automate the script to call more than 1 script as the "still open upload window " seems to halt the js script after the first macro call.

So how do we get imacro to close this upload file window? or choose a different upload method that does not trigger a file upload window..?


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. ... egoryId=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);
retcode = iimPlay(macrolist);
report += macrolist;
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
s = iimGetLastExtract(1);
/* if ( s != "" ) report += ", Extract: "+s; */
}
report += "\n";
}
alert ( report );
--------------------------------------------------End Of script ------------------------------------------------------------

The issue regarding the upload box staying open has also already been posted a while back..I do not see any resolve though unless it was answered elsewhere.

viewtopic.php?f=11&t=19627&p=50284&hilit=close+upload+dialog+box#p50284

I would like to further state. some other info that may be useful in this case.

OS: Win 7 Ultimate ( Latest service pack as of October 08 2015 ) It you need it to be more precise just ask :)
Browser: Firefox ESR 38.3.0
Imacro version for Firefox 8.9.4
Tom, Tech Support
Posts: 3498
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros not closing file Upload window after upload.

Post by Tom, Tech Support » Thu Oct 15, 2015 12:47 pm

Hi webcan,

Reposting my support ticket response here for the benefit of other users:
After a bit of troubleshooting, I discovered that the file upload on this site is handled very similarly to the German ebay Kleinanzeigen site. I posted a solution for that site in this forum post, but that method only works for iMacros for IE and the iMacros browser:

However, after some further fiddling with the macro, I realized that the TAG command to click the Select Images button is not required. In fact, it's actually redundant and causes the file upload dialog to appear a second time, which is why it goes unhandled. So if you simply remove the following TAG command(s) from the macro, it should work:

Code: Select all

TAG POS=1 TYPE=BUTTON FORM=ACTION:/p-submit-ad.html ATTR=TXT:Select<SP>Images
Regards,

Tom, iMacros Support
newguy44
Posts: 11
Joined: Thu Jan 07, 2016 10:08 pm

Re: Imacros not closing file Upload window after upload.

Post by newguy44 » Fri Oct 07, 2016 1:24 am

Tom, Tech Support wrote:Hi webcan,

Reposting my support ticket response here for the benefit of other users:
After a bit of troubleshooting, I discovered that the file upload on this site is handled very similarly to the German ebay Kleinanzeigen site. I posted a solution for that site in this forum post, but that method only works for iMacros for IE and the iMacros browser:

However, after some further fiddling with the macro, I realized that the TAG command to click the Select Images button is not required. In fact, it's actually redundant and causes the file upload dialog to appear a second time, which is why it goes unhandled. So if you simply remove the following TAG command(s) from the macro, it should work:

Code: Select all

TAG POS=1 TYPE=BUTTON FORM=ACTION:/p-submit-ad.html ATTR=TXT:Select<SP>Images

Hi any update on this as this solution does not seem to work anymore for Kijiji since they implemented a new user interface?
Thanks
Post Reply