LOADSELECTION c:\list.txt

English support forum

Moderators: Hacker, petermad, Stefan2, white

bogordo
Member
Member
Posts: 174
Joined: 2019-12-06, 09:07 UTC

LOADSELECTION c:\list.txt

Post by *bogordo »

Hi, can't find how the new Save/loadselection commands work, tried this but no luck:

Code: Select all

SAVESELECTION c:\list.txt
Any clues there?? thanks!!
TC license #346559
bogordo
Member
Member
Posts: 174
Joined: 2019-12-06, 09:07 UTC

Re: LOADSELECTION c:\list.txt

Post by *bogordo »

Ok So it is like

Code: Select all

cm_SaveSelectionToFile c:\test.txt
but the TXT is not write directly, instead i get a dialog to put a name and click Save... :roll:
TC license #346559
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

bogordo wrote: 2020-02-05, 20:43 UTC Hi, can't find how the new Save/loadselection commands work, tried this but no luck:

Code: Select all

SAVESELECTION c:\list.txt
Any clues there?? thanks!!
Hi,
First mark the files and then press the button.
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

bogordo wrote: 2020-02-05, 20:58 UTC Ok So it is like

Code: Select all

cm_SaveSelectionToFile c:\test.txt
but the TXT is not write directly, instead i get a dialog to put a name and click Save... :roll:
To this point there are very interesting solutions from petermad - look here.
bogordo
Member
Member
Posts: 174
Joined: 2019-12-06, 09:07 UTC

Re: LOADSELECTION c:\list.txt

Post by *bogordo »

tuska wrote: 2020-02-05, 22:04 UTC
bogordo wrote: 2020-02-05, 20:43 UTC Hi, can't find how the new Save/loadselection commands work, tried this but no luck:

Code: Select all

SAVESELECTION c:\list.txt
Any clues there?? thanks!!
Hi,
First mark the files and then press the button.
Yep, they are marked/selected first, but i get the dialog, no direct writing/saving....
TC license #346559
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Re: LOADSELECTION c:\list.txt

Post by *Ovg »

Code: Select all

SAVESELECTION c:\list.txt
In TC 9.50 working without any dialogs (if you have rights to write to root of the drive C)

History wrote:
"... Options added during the development of 9.22 (but only added to 9.50):

20.02.19 Added: New internal command with parameters: LOADSELECTION <filename>: Load selection from specified file (32/64)
20.02.19 Added: New internal commands with parameters: SAVESELECTION, SAVESELECTIONA, SAVESELECTIONW, SAVEDETAILS,
              SAVEDETAILSA, SAVEDETAILSW to save selection in default, ANSI or Unicode format to the specified file,
              without or with all details (32/64) ...."
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

I had to start TC as administrator - only then I could create "c:\list.txt".

Button:

Code: Select all

TOTALCMD#BAR#DATA
*%COMMANDER_EXE%
%Z/N %X"%P" "%T"
%COMMANDER_PATH%\TCMADM64.EXE
TC as Admin || Start separate TC instance with admin rights... |PC name + ^ appears in title bar |*%COMMANDER_EXE% %Z/N %X"%P" "%T"|https://ghisler.ch/board/viewtopic.php?t=49620


-1
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7014
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: LOADSELECTION c:\list.txt

Post by *Horst.Epp »

tuska wrote: 2020-02-06, 16:46 UTC I had to start TC as administrator - only then I could create "c:\list.txt".
...
What other behaviour did you expect ? :)
You can't write files into the root of drive C: without Admin rights.
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1396a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.6 x64
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

Horst.Epp wrote: 2020-02-06, 16:57 UTC
tuska wrote: 2020-02-06, 16:46 UTC I had to start TC as administrator - only then I could create "c:\list.txt".
...
What other behaviour did you expect ? :)
You can't write files into the root of drive C: without Admin rights.
Yes, you're right.
Sometimes I am a bit insecure and therefore formulate more safely.
:)
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: SAVESELECTION/LOADSELECTION c:\list.txt

Post by *tuska »

2bogordo
An answer is still pending -> LOADSELECTION

Example:

Code: Select all

SAVESELECTION Path\to\list.txt 
LOADSELECTION Path\to\list.txt

D:\Testfolder\Folder1\1.jpg
D:\Testfolder\Folder1\2.jpg
D:\Testfolder\Folder1\3.jpg
D:\Testfolder\Folder1\4.jpg
D:\Testfolder\Folder1\5.jpg
D:\Testfolder\Folder1\6.jpg
D:\Testfolder\Folder1\7.jpg
1. Mark the files, e.g. 3.jpg, 4.jpg and 5.jpg
2. Click on a button with command: SAVESELECTION D:\Testfolder\Folder1\list.txt
    D:\Testfolder\Folder1\list.txt was created [and the marker in this folder is removed e.g. after ALT+TAB, ALT+TAB]
3. Remove the markings
4. Click on a button with command: LOADSELECTION D:\Testfolder\Folder1\list.txt
    The files 3.jpg, 4.jpg and 5.jpg in the folder D:\Testfolder\Folder1\ are marked again
    Attention:
    - With the command LOADSELECTION the TC window in which the files to be marked are located must be active(!),
      in this case this is the folder D:\Testfolder\Folder1\
    - It does not matter where the file list.txt is located, i.e. it could also be located here:
      D:\Test images\list.txt (the path in the button must be correct, i.e. LOADSELECTION D:\Test images\list.txt)
5. Hints:
    - If the path is located in the root directory of drive C:, e.g. C:\list.txt, then admin rights are required
      to save the file list.txt there --> see button above...
    - Paths with spaces do not have to be enclosed in quotation marks
User avatar
petermad
Power Member
Power Member
Posts: 16118
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: LOADSELECTION c:\list.txt

Post by *petermad »

2tuska
In my new Extended Menus for TC 9.50 (see signature) I use it like this:

Code: Select all

[em_ext_saveselection]
cmd=SAVESELECTION
param="%PSELECTEDFILES.txt"
menu=Save file names in the file SELECTEDFILES.txt

Code: Select all

[em_ext_loadselection]
cmd=LOADSELECTION
param="%PSELECTEDFILES.txt"
menu=Get file names from the file SELECTEDFILES.txt
This way the SELECTEDFILES.txt is saved in current directory and must also be present in current directory for loading the selection. I have chosen capital letters for the file, so that it is easy to see its prescense. It is meant for temporery saving a selection and should be deleted when there is no more use for it.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

2petermad
Thank you for sharing your solutions with us!
Above I have already pointed out other solutions from you.

Unfortunately I cannot come up with such elegant and perfect solutions.


Regards
Karl
bogordo
Member
Member
Posts: 174
Joined: 2019-12-06, 09:07 UTC

Re: LOADSELECTION c:\list.txt

Post by *bogordo »

Thanks guys, really helpful, Petermad you are the man, this is working GREAT!!

BTW i can't get woking:

A_ Using "cm_SaveSelectionToFile c:\test.txt" stills get save dialog (even running in Admin mode).
B_ "SAVESELECTION c:\list.txt" doe snot work at all, "File not found!" error. Don't understand where is the typica "cm_" in this execution...
TC license #346559
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

bogordo wrote:BTW i can't get woking:
A_ Using "cm_SaveSelectionToFile c:\test.txt" stills get save dialog (even running in Admin mode).
Enter cm_CommandBrowser in the command line of TC and press <ENTER>.
Under "Category" click on "Commands with parameters".

The command "cm_SaveSelectionToFile" is not listed here.
That means "cm_SaveSelectionToFile c:\test.txt" is not a valid command.

"cm_SaveSelectionToFile" is a valid command, for which a "Save as..." dialog appears.
You can also enter "cm_SaveSelectionToFile" in the TC command line and press <ENTER>...
User avatar
tuska
Power Member
Power Member
Posts: 4114
Joined: 2007-05-21, 12:17 UTC

Re: LOADSELECTION c:\list.txt

Post by *tuska »

bogordo wrote:B_ "SAVESELECTION c:\list.txt" doe snot work at all, "File not found!" error.
For me, it works as described above.

Give us a detailed description of your work steps please - maybe someone can help you.
Post Reply