Page 2 of 2

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-27, 21:03 UTC
by Hacker
noychoH,
Can also be easily done using AutoHotkey (a 3rd party scripting language).

Roman

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-27, 23:03 UTC
by petermad
2noychoH
Sorry - it has to be a fixed filename, not a dynamically generated filename - I cannot transfer the keyword to the filename, there is no way to get that info.
I could add the date to the filename though, using DOS - the format of the date would depend on the language settiing of your Windows.

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 06:39 UTC
by noychoH
@petermad

Yes, that's what I was afraid of. But if you could add the system date with the hour, then at least the files would not overwrite each other if they are still there. And I could change my habits, adding the %keyword string in the end of the name rather than in the middle (this could be done in a much easier way), if I need to save the file for later use. The date format you are talking about is perfect for me.

So let's make it: save to the file: f:\pobrane\search-%date&hour.txt
Thank you.
Best,
noychoH

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 06:44 UTC
by noychoH
@Hacker and @All
Thanks for your suggestion. In my free time (i.e. when I finish correcting the student's exam works, many more this year than usual, due to online teaching), I will have a look into it. As well as into all the other suggestions made by the others. I was thinking until recently that I know TC very well, but I suppose my education halted at the level of WC 4.03, when was it? Some 30 years ago, I guess. ;-)

greetings,

noychoH

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 10:55 UTC
by petermad
2noychoH
So let's make it: save to the file: f:\pobrane\search-%date&hour.txt
Then I need to know the format of the output of the two DOS commands DATE and TIME in your locale - so please open a command promt window and run first the command DATE and then the command TIME and report here what the output is for each one...

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 14:45 UTC
by noychoH
Here you are, the output of the two commands:

The current date is: 28.06.2020
Enter the new date: (dd-mm-yy)

The current time is: 16:44:51,02
Enter the new time:

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 15:39 UTC
by noychoH
Of course if the date could be in the ISO format (yyyy-mm-dd) it would be easier for sorting, as my approach to sorting and storing the files has to change), but that is not so important.

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 15:47 UTC
by noychoH
I ind it funny that you, as a convinced TC user, write:
please open a command promt window
. ;-)

I almost never do such thing, I just write DOS commands directly in the TC command line, filtered through |pause or |more, or I redirect the output to a file if needed (like in this case).

Regards,

noychoH

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 20:38 UTC
by petermad
2noychoH
OK here it comes - first you have to make two user-defined commands in your usercmd.ini file - it should be located the same place as your totalcmd.ini file. If you don't have it, just make it in notepad (you can also create and edit it with the command cm_CommandBrowser).

Put these two entries in usercmd.ini:

Code: Select all

[em_savedetails]
cmd=SAVEDETAILS "f:\pobrane\SAVEDDETAILS.txt"
menu=Save file info in the file f:\pobrane\SAVEDDETAILS.txt

Code: Select all

[em_rename_savedetails]
cmd=%COMSPEC% /C if "%time:~0,1%" geq "0" (ren "f:\pobrane\SAVEDDETAILS.txt" "Search-%date:~6,4%-%date:~3,2%-%date:~0,2%&%time:~0,2%.%time:~3,2%.%time:~6,2%.txt") else ren "f:\pobrane\SAVEDDETAILS.txt" "Search-%date:~6,4%-%date:~3,2%-%date:~0,2%&0%time:~1,1%.%time:~3,2%.%time:~6,2%.txt"
iconic=1
menu=Rename the file with date and time
And then put this button in your buttonbar:

Code: Select all

TOTALCMD#BAR#DATA
cm_SelectAllFiles, em_savedetails, cm_ClearAll, cm_GoToParent, cm_Wait 500, em_rename_savedetails

wcmicons.dll,46
Save file info for all shown files in listbox to a text file


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".

The em_rename_savedetails command is a bit long, because it takes into consideration that DOS' TIME command does not use a leading 0 in hours less than 10 (at least not on my system, here it put an space in front of hours less than 10), but I think leading 0 is better for sorting purposes.

I have used periods between hours, minutes and seconds - because : (colon) is not allowed in a filename. But you can of course use another separator.

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-28, 20:49 UTC
by petermad
Alternative em_rename_savedetails with % before the date and - between hours-minutes-seconds.

Code: Select all

[em_rename_savedetails]
cmd=%COMSPEC% /C if "%time:~0,1%" geq "0" (ren "f:\pobrane\SAVEDDETAILS.txt" "Search-%%date:~6,4%-%date:~3,2%-%date:~0,2%&%time:~0,2%-%time:~3,2%-%time:~6,2%.txt") else ren "f:\pobrane\SAVEDDETAILS.txt" "Search-%%date:~6,4%-%date:~3,2%-%date:~0,2%&0%time:~1,1%-%time:~3,2%-%time:~6,2%.txt"
iconic=1
menu=Rename the file with date and time
.

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-29, 08:51 UTC
by noychoH
@PETERMAD
Thank you so much. When you have done it and I am looking at it, it seems soooo easy. But to do it myself would be pain in ass. Thank you again. You're very helpful. I will implement it immediately!

Greetings

noychoH

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-29, 08:53 UTC
by noychoH
Of course this help of yours is a temporary solution, so I hope (not for myself any longer, but for others) that my proposal of creating the additional button in the Find Files window, would be taken up seriously by those who would work on some future version of TC. Many operations that could be done in such a way as presented here, have found their way into the interface of TC. I think this one is worth being takenb into consideration, too.
Greetings to all,
noychoH

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-29, 12:14 UTC
by Usher
noychoH wrote: 2020-06-28, 15:47 UTC I just write DOS commands directly in the TC command line, filtered through |pause or |more
What for? Let TC work. Just type any command you need and press Shift+Enter.

Re: Save list of files alfter Alt-F7 (AltF7) search

Posted: 2020-06-29, 18:18 UTC
by noychoH
Thanks, Usher, for your advice. To answer your (rhetoric, I suppose, but anyhow) question, it's only that I am used to DOS commands since 1980-ies, so if I know how to solve the issue, I am not looking for anything else.
noychoH