Choosing uploaded file by date

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Choosing uploaded file by date

by ardjun on Mon Mar 27, 2017 3:22 pm

Hello,
I'm making a script that would allow me to automatize a process on a webpage but i have stumbled upon a problem
where i would like to choose the oldest file in a specified location but i'm unable to do so.
Normal tag for file upload looks something like this:
TAG POS=1 TYPE=INPUT:FILE FORM=ID:demo ATTR=NAME:uploaded_file CONTENT="{{!FOLDER_DATASOURCES}}\\Address.csv"

I tried using a wildcard after CONTENT but it's not working.
Is there any solution or workaround for this problem?
Thanks in advance.

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
Last edited by ardjun on Tue Mar 28, 2017 1:00 am, edited 3 times in total.
ardjun
 
Posts: 5
Joined: Mon Mar 27, 2017 3:07 pm

Re: Choosing uploaded file by date

by chivracq on Mon Mar 27, 2017 6:14 pm

ardjun wrote:Hello,
I'm making a script that would allow me to automatize a process on a webpage but i have stumbled upon a problem
where i would like to choose the oldest file in a specified location but i'm unable to do so.
Normal tag for file upload looks something like this:
Code: Select all
TAG POS=1 TYPE=INPUT:FILE FORM=ID:demo ATTR=NAME:uploaded_file CONTENT="{{!FOLDER_DATASOURCES}}\\Address.csv"


I tried using a wildcard after CONTENT but it's not working.
Is there any solution or workaround for this problem?
Thanks in advance.

Hum..., interesting Case :D , and yep..., I would have a few Ideas on how to implement your Scenario, but start by using the Forum "correctly" from the beginning, ah-ah...!
=> CIM...! :mrgreen: (Read my Sig... (or the Forum Rules...))
Even if I know already that you are not on CR and if on FF not using v9.0.3, but sorry, Users trying to help you shouldn't have to play "little Detective" for that...

Hum, and you have a Typo in your 1-Line Script I see already, ah-ah...! :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Choosing uploaded file by date

by ardjun on Tue Mar 28, 2017 1:01 am

Updated my post. Please read the missing information.
ardjun
 
Posts: 5
Joined: Mon Mar 27, 2017 3:07 pm

Re: Choosing uploaded file by date

by chivracq on Tue Mar 28, 2017 4:30 am

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Choosing uploaded file by date

by ardjun on Fri Mar 31, 2017 6:53 am

Thanks for the extensive reply.
I managed to get the small bat working, which would find the oldest file but i'm unsure how to pass this information to imacros in order to make it upload
this file.
This is what i managed so far but i'm getting an error.
This is the part that should upload the file.
Code: Select all
VERSION BUILD=11.5.499.3066
TAB T=1
SET !PLAYBACKDELAY 0.2
SET !DATASOURCE \\kscmssos01\FSSC\MD_Billing\KIT_ISR\KIT\Jano\DIR_Output.txt
SET !DATASOURCE_LINE 4
SET File_Name EVAL("var s='{{!COL1}}'; var x,y,z; z=s.substr(38); z;")
'PROMPT {{!COL3}}{{File_NAME}}
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:fileToUpload CONTENT="\\kscmssos01\FSSC\MD_Billing\KIT\WAOC\INPUT\JanciJurco\{{!COL2}}{{File_Name}}"
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:btnUpload



Another issue i have is that i'd like to use both the bat file and the imacro script together without having to do it separately each time.
Since FF wouldn't work with this page i have to resort to other possibility.
I could run the bat with AHK but i don't know how to run imacros macro with AHK, or if it's even possible.
If autoit can do that i could use it too.
ardjun
 
Posts: 5
Joined: Mon Mar 27, 2017 3:07 pm

Re: Choosing uploaded file by date

by chivracq on Fri Mar 31, 2017 9:30 pm

ardjun wrote:Thanks for the extensive reply.
I managed to get the small bat working, which would find the oldest file but i'm unsure how to pass this information to imacros in order to make it upload
this file.
This is what i managed so far but i'm getting an error.
This is the part that should upload the file.
Code: Select all
VERSION BUILD=11.5.499.3066
TAB T=1
SET !PLAYBACKDELAY 0.2
SET !DATASOURCE \\kscmssos01\FSSC\MD_Billing\KIT_ISR\KIT\Jano\DIR_Output.txt
SET !DATASOURCE_LINE 4
SET File_Name EVAL("var s='{{!COL1}}'; var x,y,z; z=s.substr(38); z;")
'PROMPT {{!COL3}}{{File_NAME}}
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:fileToUpload CONTENT="\\kscmssos01\FSSC\MD_Billing\KIT\WAOC\INPUT\JanciJurco\{{!COL2}}{{File_Name}}"
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:btnUpload



Another issue i have is that i'd like to use both the bat file and the imacro script together without having to do it separately each time.
Since FF wouldn't work with this page i have to resort to other possibility.
I could run the bat with AHK but i don't know how to run imacros macro with AHK, or if it's even possible.
If autoit can do that i could use it too.

Yeah, but sorry, this is troubleshooting in the dark for me, I need your exact 'dir' Command in your '.BAT. File as you have 2 different Paths in your '.iim' Macro, mention without me asking if you have Read Access Rights to the Folder where your Upload Files are (only Reason I can think why you would put the 'Output' File somewhere else...)
+ Post the Result of the 'dir' Command/Output, you use Line=4 instead of =6 for me and 'substr(38)' instead of 'substr(36)' for me, OK, on some Network Drive I see, and both Paths do not match but I don't have enough Info ...

Oh, and your '{{!COL2}}' in your File Upload comes completely out of the Blue..., if you used the '/-C' Switch for the 'dir' DOS Command, you don't even have a '!COL2', dunno why you want to use it...? :?

ardjun wrote:Another issue i have is that i'd like to use both the bat file and the imacro script together without having to do it separately each time.
Since FF wouldn't work with this page i have to resort to other possibility.
I could run the bat with AHK but i don't know how to run imacros macro with AHK, or if it's even possible.
If autoit can do that i could use it too.

Hum, about the "other Issue", I am not too familiar with AHK and AutoIt, even if yep I'm trying to dig a bit into AHK..., but hum, I think I already gave you one Solution: Start your Macro directly from your '.BAT' File, first the 'dir' and then the Macro...

Oh...!, and would you mind elaborating on this Statement or yours...!?:
"Since FF wouldn't work with this page i have to resort to other possibility."
=> Tja, hum-hum, why does this Page not work on FF...?
Your Site/Page will be some internal Company Site I reckon, it's nearly always possible to get it to work on FF by fooling your UA (User Agent)...

Hum, I remember some User/Thread a few months ago, maybe 1 year now, about some Chinese Bank, very strange Site that required absolutely using IE and installing some "not-to-trust" Add-on, but I think User didn't react anymore after a while, so I didn't investigate any further and dropped the Case a bit, but I think that was the only time I didn't get complete full Access on some "IE Site" with FF... But the Site was very "weird" and not really to trust... Oh...!, I think I wanted to try to decompile that Add-on, decompiling FF Add-ons is quite fun, you can decompile iMacros for example, that's quite interesting, ah-ah...!, but I never tried on IE...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Choosing uploaded file by date

by ardjun on Fri Apr 07, 2017 12:43 am

Yeah, but sorry, this is troubleshooting in the dark for me, I need your exact 'dir' Command in your '.BAT. File as you have 2 different Paths in your '.iim' Macro, mention without me asking if you have Read Access Rights to the Folder where your Upload Files are (only Reason I can think why you would put the 'Output' File somewhere else...)
+ Post the Result of the 'dir' Command/Output, you use Line=4 instead of =6 for me and 'substr(38)' instead of 'substr(36)' for me, OK, on some Network Drive I see, and both Paths do not match but I don't have enough Info ...

Oh, and your '{{!COL2}}' in your File Upload comes completely out of the Blue..., if you used the '/-C' Switch for the 'dir' DOS Command, you don't even have a '!COL2', dunno why you want to use it...? :?


dir \\kscmssos01\FSSC\MD_Billing\KIT\WAOC\INPUT\JanciJurco /-C/OD>\\kscmssos01\FSSC\MD_Billing\KIT_ISR\KIT\Jano\DIR_Output.txt
My dir output is:
Code: Select all
 Volume in drive \\kscmssos01\FSSC is DATA
 Volume Serial Number is 6CD9-FD06

 Directory of \\kscmssos01\FSSC\MD_Billing\KIT\WAOC\INPUT\JanciJurco

30. 03. 2017  16:49            104021 10152711_it07_21.03.17_201703301648.pdf
30. 03. 2017  17:41            302409 11594132_11.02.17_PER_201703301745.pdf
30. 03. 2017  17:43            442285 10204210_21.02.17_PER_201703301747.pdf
30. 03. 2017  17:43            416874 10201791_21.02.17_PER_201703301747.pdf
30. 03. 2017  17:44            421786 10204211_21.02.17_PER_201703301748.pdf
30. 03. 2017  17:45            174237 10203432_16.02.17_PER_201703301749.pdf
30. 03. 2017  17:45            197843 10203408_09.02.17_STR_201703301749.pdf
30. 03. 2017  17:46            176761 11374149_19.01.17_PER_201703301751.pdf
30. 03. 2017  17:48            175853 11013119_19.01.17_PER_201703301752.pdf
31. 03. 2017  10:46            243454 10205373-PER-09-03-17      A14.pdf
31. 03. 2017  11:19            386265 11593922-PER-15-03-17      A15.pdf
31. 03. 2017  13:17            265788 11165470-PER-27-03-17     A18.pdf
31. 03. 2017  13:18            186670 11165470-STRAORD- 27-03-17   A18a.pdf
31. 03. 2017  13:32            253685 11046055-PER-27-03-17-    A31.pdf
31. 03. 2017  14:06            237451 10204731-PER-28-03-17     A40.pdf
31. 03. 2017  14:07            240149 10204732-PER-28-03-17     A41.pdf
31. 03. 2017  14:08            241724 10204730-PER-28-03-17     A42.pdf
31. 03. 2017  14:09            237152 10204733-PER-28-03-17      A43.pdf
31. 03. 2017  14:10            243612 10204729-PER-28-03-17      A44.pdf
31. 03. 2017  14:11            236085 10231202-PER-28-03-17      A45.pdf
31. 03. 2017  14:13            239854 10205297-PER-28-03-17    A47.pdf
31. 03. 2017  14:18            224633 11655859-PER-10-10-16    A51  IøFOGLIO.pdf
31. 03. 2017  14:27            257909 10220742-PER-29-03-17    A54.pdf
31. 03. 2017  16:24            181456 11558854-PER-24-03-17    A60.pdf
31. 03. 2017  16:25            182238 11558856-PER-24-03-17    A61.pdf
31. 03. 2017  16:28            179806 10869432-PER-24-03-17    A64.pdf
31. 03. 2017  16:38            177965 10204683_16.02.17_PER_201703311642.pdf
31. 03. 2017  16:38            191817 10201336_09.02.17_PER_201703311643.pdf
31. 03. 2017  16:39            199077 10201336_09.02.17_STR_201703311643.pdf
31. 03. 2017  16:42            179269 11131063_23.03.17_PER_201703311646.pdf
31. 03. 2017  16:42            178584 11131062_23.03.17_PER_201703311646.pdf
31. 03. 2017  16:42            173797 11131072_23.03.17_PER_201703311647.pdf
31. 03. 2017  16:43            179622 11131065_23.03.17_PER_201703311647.pdf
31. 03. 2017  16:43            179688 11131064_23.03.17_PER_201703311647.pdf
31. 03. 2017  16:44            179707 11131056_23.03.17_PER_201703311648.pdf
31. 03. 2017  16:44            177126 11131057_23.03.17_PER_201703311648.pdf
03. 04. 2017  08:11            192823 10175162_11.01.2016_per_201704030810.pdf
03. 04. 2017  08:12            109258 11535030_24.01.2017_per_201704030811.pdf
03. 04. 2017  08:14             62211 10174167_24.02.2017_per_201704030813.pdf
03. 04. 2017  08:15             59462 10916165_23.02.2017_per_201704030813.pdf
03. 04. 2017  08:15             60326 10916132_23.02.2017_201704030814.pdf
03. 04. 2017  08:16             60439 10249147_23.02.2017_per_201704030814.pdf
03. 04. 2017  08:16             60190 10916134_23.02.2017_per_201704030815.pdf
03. 04. 2017  08:17             61817 10903942_22.02.2017_per_201704030815.pdf
03. 04. 2017  08:17             61924 10174170_24.02.2017_per_201704030815.pdf
03. 04. 2017  08:17             78153 10175954_18.01.2017_per_201704030816.pdf
03. 04. 2017  08:18             83522 10175952_18.01.2017_per_201704030816.pdf
03. 04. 2017  08:18             67627 10291604_18.01.2017_per_201704030817.pdf
03. 04. 2017  08:18             72170 11116256_17.01.2017_per_201704030817.pdf
03. 04. 2017  08:19             70705 42166054_17.01.2017_per_201704030817.pdf
03. 04. 2017  08:19             89743 11374159_07.10.2016_per_201704030818.pdf
03. 04. 2017  08:20             89324 10496879_07.10.2016_per_201704030818.pdf
03. 04. 2017  08:20             66554 10172920_27.12.2016_per_201704030819.pdf
03. 04. 2017  08:20             73332 11080590_11.11.2016_per_201704030819.pdf
03. 04. 2017  08:21             72228 10800873_28.10.2016_per_201704030819.pdf
03. 04. 2017  08:21             75665 10437343_05.12.2016_str_201704030820.pdf
03. 04. 2017  08:21             73523 10173018_12.01.2017_per_201704030820.pdf
03. 04. 2017  08:22            101546 42539585_20.01.2017_per_201704030820.pdf
03. 04. 2017  08:22             64425 11399096_30.01.2017_per_201704030821.pdf
04. 04. 2017  16:51    <DIR>          Issues
04. 04. 2017  17:19    <DIR>          fatto
04. 04. 2017  17:19    <DIR>          .
04. 04. 2017  17:19    <DIR>          ..
              59 File(s)       10073619 bytes
               4 Dir(s)     17706225664 bytes free

I don't understan how !COL works but after fiddling a bit with this i found a way to get exactly just the name of the file.
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1

SET !DATASOURCE \\kscmssos01\FSSC\MD_Billing\KIT_ISR\KIT\Jano\DIR_Output.txt
SET !DATASOURCE_LINE 4

SET File_Name EVAL("var s='{{!COL1}}'; var x,y,z; z=s.substr(38); z;")
'PROMPT {{!COL3}}<BR>File_Name:<SP>_{{File_Name}}_
PROMPT {{!COL3}}{{File_NAME}}

The output is just the filename.
If i'm doing it wrong please let me know. I'm just starting with iMacros.
I'm using two different folders because files in one are deleted many times and i wanted to keep it clean for not confusing other people.

Hum, about the "other Issue", I am not too familiar with AHK and AutoIt, even if yep I'm trying to dig a bit into AHK..., but hum, I think I already gave you one Solution: Start your Macro directly from your '.BAT' File, first the 'dir' and then the Macro...

Oh...!, and would you mind elaborating on this Statement or yours...!?:
"Since FF wouldn't work with this page i have to resort to other possibility."
=> Tja, hum-hum, why does this Page not work on FF...?
Your Site/Page will be some internal Company Site I reckon, it's nearly always possible to get it to work on FF by fooling your UA (User Agent)...

Hum, I remember some User/Thread a few months ago, maybe 1 year now, about some Chinese Bank, very strange Site that required absolutely using IE and installing some "not-to-trust" Add-on, but I think User didn't react anymore after a while, so I didn't investigate any further and dropped the Case a bit, but I think that was the only time I didn't get complete full Access on some "IE Site" with FF... But the Site was very "weird" and not really to trust... Oh...!, I think I wanted to try to decompile that Add-on, decompiling FF Add-ons is quite fun, you can decompile iMacros for example, that's quite interesting, ah-ah...!, but I never tried on IE...


That page isn't optimized for firefox and therefore it doesn't show all the fields in a way as it should. It looks ugly and uncomplete.

I will try to make a batch file to run imacro script but my first attempt so far was unsuccesful becuse it opened a new page each time.
I can run the bat with ahk then.
ardjun
 
Posts: 5
Joined: Mon Mar 27, 2017 3:07 pm

Re: Choosing uploaded file by date

by chivracq on Fri Apr 07, 2017 4:33 pm

ardjun wrote:
Yeah, but sorry, this is troubleshooting in the dark for me, I need your exact 'dir' Command in your '.BAT. File as you have 2 different Paths in your '.iim' Macro, mention without me asking if you have Read Access Rights to the Folder where your Upload Files are (only Reason I can think why you would put the 'Output' File somewhere else...)
+ Post the Result of the 'dir' Command/Output, you use Line=4 instead of =6 for me and 'substr(38)' instead of 'substr(36)' for me, OK, on some Network Drive I see, and both Paths do not match but I don't have enough Info ...

Oh, and your '{{!COL2}}' in your File Upload comes completely out of the Blue..., if you used the '/-C' Switch for the 'dir' DOS Command, you don't even have a '!COL2', dunno why you want to use it...? :?


Code: Select all
dir \\kscmssos01\FSSC\MD_Billing\KIT\WAOC\INPUT\JanciJurco /-C/OD>\\kscmssos01\FSSC\MD_Billing\KIT_ISR\KIT\Jano\DIR_Output.txt

My dir output is:
Code: Select all
 Volume in drive \\kscmssos01\FSSC is DATA
 Volume Serial Number is 6CD9-FD06

 Directory of \\kscmssos01\FSSC\MD_Billing\KIT\WAOC\INPUT\JanciJurco

30. 03. 2017  16:49            104021 10152711_it07_21.03.17_201703301648.pdf
30. 03. 2017  17:41            302409 11594132_11.02.17_PER_201703301745.pdf
30. 03. 2017  17:43            442285 10204210_21.02.17_PER_201703301747.pdf
30. 03. 2017  17:43            416874 10201791_21.02.17_PER_201703301747.pdf
30. 03. 2017  17:44            421786 10204211_21.02.17_PER_201703301748.pdf
30. 03. 2017  17:45            174237 10203432_16.02.17_PER_201703301749.pdf
30. 03. 2017  17:45            197843 10203408_09.02.17_STR_201703301749.pdf
30. 03. 2017  17:46            176761 11374149_19.01.17_PER_201703301751.pdf
30. 03. 2017  17:48            175853 11013119_19.01.17_PER_201703301752.pdf
31. 03. 2017  10:46            243454 10205373-PER-09-03-17      A14.pdf
31. 03. 2017  11:19            386265 11593922-PER-15-03-17      A15.pdf
31. 03. 2017  13:17            265788 11165470-PER-27-03-17     A18.pdf
31. 03. 2017  13:18            186670 11165470-STRAORD- 27-03-17   A18a.pdf
31. 03. 2017  13:32            253685 11046055-PER-27-03-17-    A31.pdf
31. 03. 2017  14:06            237451 10204731-PER-28-03-17     A40.pdf
31. 03. 2017  14:07            240149 10204732-PER-28-03-17     A41.pdf
31. 03. 2017  14:08            241724 10204730-PER-28-03-17     A42.pdf
31. 03. 2017  14:09            237152 10204733-PER-28-03-17      A43.pdf
31. 03. 2017  14:10            243612 10204729-PER-28-03-17      A44.pdf
31. 03. 2017  14:11            236085 10231202-PER-28-03-17      A45.pdf
31. 03. 2017  14:13            239854 10205297-PER-28-03-17    A47.pdf
31. 03. 2017  14:18            224633 11655859-PER-10-10-16    A51  IøFOGLIO.pdf
31. 03. 2017  14:27            257909 10220742-PER-29-03-17    A54.pdf
31. 03. 2017  16:24            181456 11558854-PER-24-03-17    A60.pdf
31. 03. 2017  16:25            182238 11558856-PER-24-03-17    A61.pdf
31. 03. 2017  16:28            179806 10869432-PER-24-03-17    A64.pdf
31. 03. 2017  16:38            177965 10204683_16.02.17_PER_201703311642.pdf
31. 03. 2017  16:38            191817 10201336_09.02.17_PER_201703311643.pdf
31. 03. 2017  16:39            199077 10201336_09.02.17_STR_201703311643.pdf
31. 03. 2017  16:42            179269 11131063_23.03.17_PER_201703311646.pdf
31. 03. 2017  16:42            178584 11131062_23.03.17_PER_201703311646.pdf
31. 03. 2017  16:42            173797 11131072_23.03.17_PER_201703311647.pdf
31. 03. 2017  16:43            179622 11131065_23.03.17_PER_201703311647.pdf
31. 03. 2017  16:43            179688 11131064_23.03.17_PER_201703311647.pdf
31. 03. 2017  16:44            179707 11131056_23.03.17_PER_201703311648.pdf
31. 03. 2017  16:44            177126 11131057_23.03.17_PER_201703311648.pdf
03. 04. 2017  08:11            192823 10175162_11.01.2016_per_201704030810.pdf
03. 04. 2017  08:12            109258 11535030_24.01.2017_per_201704030811.pdf
03. 04. 2017  08:14             62211 10174167_24.02.2017_per_201704030813.pdf
03. 04. 2017  08:15             59462 10916165_23.02.2017_per_201704030813.pdf
03. 04. 2017  08:15             60326 10916132_23.02.2017_201704030814.pdf
03. 04. 2017  08:16             60439 10249147_23.02.2017_per_201704030814.pdf
03. 04. 2017  08:16             60190 10916134_23.02.2017_per_201704030815.pdf
03. 04. 2017  08:17             61817 10903942_22.02.2017_per_201704030815.pdf
03. 04. 2017  08:17             61924 10174170_24.02.2017_per_201704030815.pdf
03. 04. 2017  08:17             78153 10175954_18.01.2017_per_201704030816.pdf
03. 04. 2017  08:18             83522 10175952_18.01.2017_per_201704030816.pdf
03. 04. 2017  08:18             67627 10291604_18.01.2017_per_201704030817.pdf
03. 04. 2017  08:18             72170 11116256_17.01.2017_per_201704030817.pdf
03. 04. 2017  08:19             70705 42166054_17.01.2017_per_201704030817.pdf
03. 04. 2017  08:19             89743 11374159_07.10.2016_per_201704030818.pdf
03. 04. 2017  08:20             89324 10496879_07.10.2016_per_201704030818.pdf
03. 04. 2017  08:20             66554 10172920_27.12.2016_per_201704030819.pdf
03. 04. 2017  08:20             73332 11080590_11.11.2016_per_201704030819.pdf
03. 04. 2017  08:21             72228 10800873_28.10.2016_per_201704030819.pdf
03. 04. 2017  08:21             75665 10437343_05.12.2016_str_201704030820.pdf
03. 04. 2017  08:21             73523 10173018_12.01.2017_per_201704030820.pdf
03. 04. 2017  08:22            101546 42539585_20.01.2017_per_201704030820.pdf
03. 04. 2017  08:22             64425 11399096_30.01.2017_per_201704030821.pdf
04. 04. 2017  16:51    <DIR>          Issues
04. 04. 2017  17:19    <DIR>          fatto
04. 04. 2017  17:19    <DIR>          .
04. 04. 2017  17:19    <DIR>          ..
              59 File(s)       10073619 bytes
               4 Dir(s)     17706225664 bytes free

I don't understan how !COL works but after fiddling a bit with this i found a way to get exactly just the name of the file.
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1

SET !DATASOURCE \\kscmssos01\FSSC\MD_Billing\KIT_ISR\KIT\Jano\DIR_Output.txt
SET !DATASOURCE_LINE 4

SET File_Name EVAL("var s='{{!COL1}}'; var x,y,z; z=s.substr(38); z;")
'PROMPT {{!COL3}}<BR>File_Name:<SP>_{{File_Name}}_
PROMPT {{!COL3}}{{File_NAME}}

The output is just the filename.
If i'm doing it wrong please let me know. I'm just starting with iMacros.
I'm using two different folders because files in one are deleted many times and i wanted to keep it clean for not confusing other people.

Hum, about the "other Issue", I am not too familiar with AHK and AutoIt, even if yep I'm trying to dig a bit into AHK..., but hum, I think I already gave you one Solution: Start your Macro directly from your '.BAT' File, first the 'dir' and then the Macro...

Oh...!, and would you mind elaborating on this Statement or yours...!?:
"Since FF wouldn't work with this page i have to resort to other possibility."
=> Tja, hum-hum, why does this Page not work on FF...?
Your Site/Page will be some internal Company Site I reckon, it's nearly always possible to get it to work on FF by fooling your UA (User Agent)...

Hum, I remember some User/Thread a few months ago, maybe 1 year now, about some Chinese Bank, very strange Site that required absolutely using IE and installing some "not-to-trust" Add-on, but I think User didn't react anymore after a while, so I didn't investigate any further and dropped the Case a bit, but I think that was the only time I didn't get complete full Access on some "IE Site" with FF... But the Site was very "weird" and not really to trust... Oh...!, I think I wanted to try to decompile that Add-on, decompiling FF Add-ons is quite fun, you can decompile iMacros for example, that's quite interesting, ah-ah...!, but I never tried on IE...


That page isn't optimized for firefox and therefore it doesn't show all the fields in a way as it should. It looks ugly and uncomplete.

I will try to make a batch file to run imacro script but my first attempt so far was unsuccesful becuse it opened a new page each time.
I can run the bat with ahk then.

OK, perfect Reply, Compliments...!, but I need to do a little bit of "Thinking"... (about where to start from...)...

OK, here we go...! (I'll do a bit of clean-up, don't worry...)
I'll start with your 2nd Quote, easy to answer...:
That page isn't optimized for firefox and therefore it doesn't show all the fields in a way as it should. It looks ugly and uncomplete.

I will try to make a batch file to run imacro script but my first attempt so far was unsuccesful becuse it opened a new page each time.
I can run the bat with ahk then.

Well, don't worry about "ugly" and "incomplete" (spelt correctly, ah-ah...!), it's usually better actually (for iMacros), the HTML is "Cleaner"...

But about your Batch File, post what you tried, you have many Examples on the Forum, I will spot directly what you are doing wrong I think, even if I'm more of a FF "Specialist" but I participated in most if not all Threads pertaining to starting iMacros from a Batch File in the last 3 years, so I guess I have the "Expertise" (and I use it myself extensively, oops...!), or I will be able to locate some relevant Thread(s) with more/correct Info..

OH, but grrrr...!, sorry, I have to go now, no time now for part_1, sorry, I'm a DJ, I'm already late for a Gig oops, bump your Thread again otherwise I might forget about it...

+ I'll do the "cleaning" later...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 4 guests

-->