about save selection question and suggestion

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
masktao
Junior Member
Junior Member
Posts: 13
Joined: 2021-11-26, 05:52 UTC

about save selection question and suggestion

Post by *masktao »

Copy some files from one folder a to another folder b
Then use the Save Selection command to select the files in folder a, and finally use the Restore Selection command in folder b, but fail to successfully select the files copied from folder a
Finally, use the Export Selection command to open the exported file, and find that the file name in the file contains the path. I think this is the reason why the Restore Selection command cannot be successfully used in another different folder.
After I cleared the path, I successfully used the Restore Export File function to select the new file in folder b. If the path is not cleared, the Restore Export still fails to select the new file

My question and suggestion is
Should the Save Selection command cancel the path included in the save, or add a Save Selection command without the path to save
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50817
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: about save selection question and suggestion

Post by *ghisler(Author) »

cm_SaveSelection does not store the path unless it is part of the item (e.g. a search result).

However, cm_SaveSelection and cm_RestoreSelection store separate lists for the left and the right panel, so you can save both sides and restore them later.
Author of Total Commander
https://www.ghisler.com
masktao
Junior Member
Junior Member
Posts: 13
Joined: 2021-11-26, 05:52 UTC

Re: about save selection question and suggestion

Post by *masktao »

ghisler(Author) wrote: 2025-05-27, 08:01 UTC cm_SaveSelection does not store the path unless it is part of the item (e.g. a search result).

However, cm_SaveSelection and cm_RestoreSelection store separate lists for the left and the right panel, so you can save both sides and restore them later.
I tested it by copying the label of directory a in the right panel to the left panel and testing the restore selection function.
The key problem is that cm_RestoreSelection cannot restore selection in different folders, so what is the meaning of this command. It can only work on the original folder a, and if you want to select the same file in folder c or d, you can't select it by restoring the selection.
I have tried many times to copy the files in folder a in the right panel to folder b in the left panel.
If I want to use the restore selection command to select and delete the new files in folder b, the result is that nothing can be selected every time.
I just want to simply use the restore selection in folder d or e, restore the selection and delete the files just copied.
User avatar
white
Power Member
Power Member
Posts: 5964
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: about save selection question and suggestion

Post by *white »

2masktao
Swap the panels (Ctrl+U) and do restore selection (num /).
masktao
Junior Member
Junior Member
Posts: 13
Joined: 2021-11-26, 05:52 UTC

Re: about save selection question and suggestion

Post by *masktao »

white wrote: 2025-05-27, 09:51 UTC 2masktao
Swap the panels (Ctrl+U) and do restore selection (num /).
Copy the files in folder a on the right panel to the new folder on the left panel, select all the files in folder a, and save the selection. Switch to the new folder, and use restore selection to no effect. Ctrl+U still cannot restore the selection successfully in another folder. Restoration selection can only work in the source folder.
I tried to restore the selection in the new folder and thought the method was successful: Save selection - open the saved file - remove the file path and only keep the file name, read the text of the restored selection in the new folder - selection is successful
User avatar
white
Power Member
Power Member
Posts: 5964
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: about save selection question and suggestion

Post by *white »

masktao wrote: 2025-05-27, 10:47 UTC Ctrl+U still cannot restore the selection successfully in another folder. Restoration selection can only work in the source folder.
As Ghisler said, it works in the source panel. It doesn't matter which folder is displayed in the panel. So swapping panels and then restoring the selection works. Unless your panel contains search results, but that does not seem to be the case here.
User avatar
petermad
Power Member
Power Member
Posts: 16096
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: about save selection question and suggestion

Post by *petermad »

cm_SaveSelection and cm_RestoreSelection works pr. file panel : source / target selections are saved/restored independently.

Instead You can use:
cm_CopyFullNamesToClip and cm_LoadSelectionFromClip - it will work the same in both file panels.
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
petermad
Power Member
Power Member
Posts: 16096
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: about save selection question and suggestion

Post by *petermad »

2masktao
see also viewtopic.php?p=472283#p472283 - where you asked the same question
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
masktao
Junior Member
Junior Member
Posts: 13
Joined: 2021-11-26, 05:52 UTC

Re: about save selection question and suggestion

Post by *masktao »

petermad wrote: 2025-05-27, 12:20 UTC cm_SaveSelection and cm_RestoreSelection works pr. file panel : source / target selections are saved/restored independently.

Instead You can use:
cm_CopyFullNamesToClip and cm_LoadSelectionFromClip - it will work the same in both file panels.
Thanks bro
cm_LoadSelectionFromClip I didn't find this command before, it solved my problem, thank you very much
masktao
Junior Member
Junior Member
Posts: 13
Joined: 2021-11-26, 05:52 UTC

Re: about save selection question and suggestion

Post by *masktao »

petermad wrote: 2025-05-27, 12:50 UTC 2masktao
see also viewtopic.php?p=472283#p472283 - where you asked the same question
Sorry for posting two threads. I saw that there are many different language sections in the forum, so I thought I could just post in the English section.
Finally, in that thread, my needs and problem were perfectly solved.
cm_LoadSelectionFromClip is great
User avatar
white
Power Member
Power Member
Posts: 5964
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: about save selection question and suggestion

Post by *white »

Moderator message from: white » 2025-05-27, 23:15 UTC

Topics merged.
Post Reply