Save selection to file with paths

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Save selection to file with paths

Post by *andres992 »

Presently, there is the command cm_SaveSelectionToFile (in Mark menu), which creates a txt file of the selected file names. But the txt file does not contain paths. When I use this command after Ctrl+B, then I get some kind of "half-paths".

I am in a situation where I need such a txt file containing a file list with full paths on every line. I can do it now by:

(1) selecting the files to be listed;
(2) Mark -> Copy files with path to clipboard;
(3) create an empty txt file
(4) paste;
(5) save the txt file.

However, it would be a little handier if there was a command in the Mark menu, called "Save selection to file with paths".
#68776 Personal Licence
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

What do you want to do with such list? There are commands that copies selected files with paths to clipboard (cm_CopyFullNamesToClip or cm_CopyNetNamesToClip) so you can then save such list. If you need to pass such list to some program, you can use %L (or %UL or %WL depending on desired charset, help describes them all) parameter from TC buttonbar button or user-command, and it will be substituted with path to temporary filelist. E.g. add a button with command notepad.exe and paramerer %WL and try clicking it. :wink:

Note that you can open buttonbar configuration and look through huge list of available internal commands, you'll find a lot of commands that are absent in default main menu. Main menu may be edited, you can add internal commands or custom user-commands there.
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

It was just a suggestion. I would need such a command but I can do without it as described above. I could even do without TC but that would be a sad life :D

There is the similar command "Save selection to file" and certainly the Mark menu would be shorter, perhaps more economical without it but the command is still in the menu.

I could not find an internal command (cm_x) for such action that I asked for.

In reply to your question: yes, I need to pass that list to another program but not on the command line. I will need to pass that list to another program as a txt file.
#68776 Personal Licence
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1014
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

+ support

%L implies hunting for the file. This wouldn't
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

%L implies hunting for the file. This wouldn't
Well it's quiet hot.

Just copy the follwing to your buttonbar and you get a button which copies the temporary filelist to a permanent "MyList.txt"

Code: Select all

TOTALCMD#BAR#DATA
cmd.exe /c copy
"%L" MyList.txt
%COMMANDER_PATH%\TOTALCMD.EXE,2



-1
#5767 Personal license
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Button code:

Code: Select all

TOTALCMD#BAR#DATA
%comspec% /c copy
"%WL" "%T\SelectedFiles.txt"
%comspec%
Selected files to list in target path

1
-1
2ZoSTeR
- No hunting for the list file
- No File-Select-Box
- Just a simple text file inside the target panel

Regards
Holger
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Using e.g. AskParam it is possible to show nice dialog to enter list file name.
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

Thanks for the suggestions! The toolbar button works all right and is indeed faster than the method I described (although it leaves a bit less choice). The problem was not exactly that I could not get the task done, however. It can also be done by the method I first described.

By the logic of finding alternatives to anything (including by means of addons) and opposing any new feature because it could be done by other means — well, I guess that it is possible now to complete most tasks without adding anything to TC. Does it mean that nothing needs to be added to TC for that reason? As I see it, TC is there to make my life (and others' lives) easier, and therefore I suppose that any new features should not be measured just by their alternative feasibility through addons or scripting.

Maybe my suggestion was not worth it, I will not argue. But I think such things should be measured, inter alia, by user opinions, by the coding effort required and by how they would make tasks easier.

EDIT:
MVV wrote:Using e.g. AskParam it is possible to show nice dialog to enter list file name.
Could you please post an example of how this can be done?
#68776 Personal Licence
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1014
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

While we're at it, why not an AutoIt example for good measure:

Code: Select all

FileCopy($CmdLineRaw, FileSaveDialog("Save Selection", "c:\", "All (*.*)"))
Just because something is achievable with scripting or other workarounds doesn't mean it shouldn't be available to casual users out of the box.
 
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

andres992,

Code: Select all

Command: AskParam.exe
Parameters: /c"Save selection to file" /t"%P%O.lst" /p"Save selection to:" /s0 cmd.exe /c "copy "%WL" "%%1""
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

MVV wrote:

Code: Select all

Command: AskParam.exe
Parameters: /c"Save selection to file" /t"%P%O.lst" /p"Save selection to:" /s0 cmd.exe /c "copy "%WL" "%%1""
Thanks, that worked nicely too!
#68776 Personal Licence
Post Reply