Save selection to file with paths
Moderators: white, Hacker, petermad, Stefan2
Save selection to file with paths
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".
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
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.
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.
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.
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
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.
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
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Well it's quiet hot.%L implies hunting for the file. This wouldn't
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
Button code:
2ZoSTeR
- No hunting for the list file
- No File-Select-Box
- Just a simple text file inside the target panel
Regards
Holger
Code: Select all
TOTALCMD#BAR#DATA
%comspec% /c copy
"%WL" "%T\SelectedFiles.txt"
%comspec%
Selected files to list in target path
1
-1
- No hunting for the list file
- No File-Select-Box
- Just a simple text file inside the target panel
Regards
Holger
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:
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:
Could you please post an example of how this can be done?MVV wrote:Using e.g. AskParam it is possible to show nice dialog to enter list file name.
#68776 Personal Licence
While we're at it, why not an AutoIt example for good measure:
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.
Code: Select all
FileCopy($CmdLineRaw, FileSaveDialog("Save Selection", "c:\", "All (*.*)"))
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""
Thanks, that worked nicely too!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""
#68776 Personal Licence