ardjun wrote:EDIT: Apologies for missing information.
I'm using Windows 7 with internet Explorer 11.0.9600.18499 and imacros v11 extension for internet Explorer, version 11.5.499.3066.
Site i'm trying to automatize is inside a corporal domain so you wouldn't have access to it.
Upload obviously isn't working because i need to select different file each time.
Code: Select all
VERSION BUILD=11.5.499.3066
TAB T=1
SET !PLAYBACKDELAY 0.2
TAG POS=1 TYPE=SELECT ATTR=NAME:ddlEsito CONTENT=%4
ONDIALOG POS=1 BUTTON=YES
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:btnImpostaEsito
TAG POS=1 TYPE=FORM ATTR=NAME:DettagliVisita
TAG POS=1 TYPE=TD ATTR=TXT:Carica<SP>Acquisisci
TAG POS=2 TYPE=A ATTR=TXT:Carica
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:fileToUpload CONTENT=\fakepath\10332810.pdf
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:btnUpload
Pause
TAG POS=1 TYPE=FORM ATTR=NAME:DettagliVisita
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:txtDataVerbale CONTENT=22/03/2017
ONDIALOG POS=1 BUTTON=YES
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:btnSalvaDataVerbale
PROMPT "How many prescriptions" !VAR1
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:txtNumeroPrescrizioni CONTENT={{!VAR1}}
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:btnImpostaNumeroPrescrizioni
TAG POS=1 TYPE=SELECT ATTR=NAME:tipoPresc1 CONTENT=%K
ardjun wrote:Updated my post. Please read the missing information.
OK, perfect for FCI...
So you are on Win7, with iMacros for IE v11.5.
One Solution I had in mind was that if you know a bit how your Files are named, it is possible to check if a specific File exists by "misusing" the '!FOLDER_DATASOURCE' Command like explained in
this Thread, to then use directly the correct FileName for your Download. But you need to be able to check some Return Code and you would need to be on FF and to use a '.js' Script.
Second Solution would be to go back to the "roots", ah-ah...!, and to use the simple DOS Command: 'dir' to output its Result to a '.TXT' File to reuse as DataSource in your Macro to fetch the Name of your oldest File with for example:
Code: Select all
dir D:\TEMP\My_Project /-C/OD>D:\TEMP\My_Project\DIR_Output.txt
Adapt the Path of course, I "placed" in my Example all your Files in some "D:\TEMP\My_Project\" Directory.
You can either run this Command manually from a DOS Prompt or place it in some mini '.BAT' File that you would run each time just before running your Macro, and the '.BAT' could even call IE and your Macro directly.
From FF with iMacros for FF, it is possible to call a '.BAT' File directly from a Macro by using the 'EVENT' Mode and some FF Add-on called "External Application Buttons" with a Shortcut, you have the 'EVENT' Mode as well now on iMacros for IE v11.5, but I'm not sure if you have some similar Add-on on IE that would allow you to call an '.EXE' or '.BAT' File from a Shortcut directly from within the Browser...
The 'dir' Command will produce a 'DIR_Output.txt' File with some Content like:
Code: Select all
Volume in drive C is Windows
Volume Serial Number is 3ED0-977F
Directory of C:\
07/11/2007 09:00 17734 eula.1028.txt
07/11/2007 09:00 17734 eula.1031.txt
07/11/2007 09:00 10134 eula.1033.txt
07/11/2007 09:00 17734 eula.1036.txt
07/11/2007 09:00 17734 eula.1040.txt
07/11/2007 09:00 118 eula.1041.txt
07/11/2007 09:00 17734 eula.1042.txt
07/11/2007 09:00 17734 eula.2052.txt
07/11/2007 09:00 17734 eula.3082.txt
07/11/2007 09:00 1110 globdata.ini
07/11/2007 09:00 843 install.ini
07/11/2007 09:00 5686 vcredist.bmp
07/11/2007 09:03 76304 install.res.1028.dll
07/11/2007 09:03 96272 install.res.1031.dll
07/11/2007 09:03 91152 install.res.1033.dll
07/11/2007 09:03 97296 install.res.1036.dll
07/11/2007 09:03 95248 install.res.1040.dll
07/11/2007 09:03 81424 install.res.1041.dll
07/11/2007 09:03 79888 install.res.1042.dll
07/11/2007 09:03 75792 install.res.2052.dll
07/11/2007 09:03 96272 install.res.3082.dll
07/11/2007 09:03 562688 install.exe
07/11/2007 09:09 1442522 VC_RED.cab
07/11/2007 09:12 232960 VC_RED.MSI
13/03/2016 02:25 <DIR> TEMP
16/07/2016 13:47 <DIR> PerfLogs
21/09/2016 14:40 <DIR> _Downloads
22/10/2016 19:15 <DIR> Users
29/01/2017 16:49 <DIR> Program Files
07/03/2017 12:40 302780 WLAN_1_Driver.log
07/03/2017 12:42 3632434 WLAN_2_WiFi.log
07/03/2017 12:42 33635 WLAN.log
14/03/2017 21:19 <DIR> Program Files (x86)
17/03/2017 21:40 <DIR> Windows
27 File(s) 7138696 bytes
7 Dir(s) 520678993920 bytes free
(I used the 'C:\' Root here in this Example, but the Content would be similar...)
And if you use this '.txt' File as your DataSource, the oldest File in the Folder will always be located at Row_6 and can be accessed with '{{!COL1}}' and isolated with some 'EVAL()' Statement with 'split()' and/or 'lastIndexOf()' and/or 'substr()'.
'substr()' might be the easiest, I would think, and in "my" case, that would give:
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !DATASOURCE D:\TEMP\My_Project\DIR_Output.txt
SET !DATASOURCE_LINE 6
SET File_Name EVAL("var s='{{!COL1}}'; var x,y,z; z=s.substr(36); z;")
PROMPT {{!COL1}}<BR>File_Name:<SP>_{{File_Name}}_
Yep, works fine, Result of the 'PROMPT':
Code: Select all
07/11/2007 09:00 17734 eula.1028.txt
File_Name: _eula.1028.txt_
(Teested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)
I have deliberately removed the Decimal Separators in the File Size (with the '/-C' Switch) because in "my" case, I had different Sizes for my Files from <1Mb + >1Mb + >1Gb and the Comma(s) in the Sizes would force me to use '!COL2' or even '!COL3' sometimes, but you might want to keep them if you know in your case that the Size of your Files is always >1Mb, then you would use '!COL2' instead of '!COL1' in my Script and that would lower the 'substr(36)' in my case to 'substr(4)', or you could use 'split()' on the Space just before the File Name...
- (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...