[BUG] cm_SaveSelection/cm_RestoreSelection
Moderators: white, Hacker, petermad, Stefan2
[BUG] cm_SaveSelection/cm_RestoreSelection
Select some files/dirs then apply the following:
1. cm_SaveSelection
2. cm_ClearAll
3. cm_CopyNamesToClip
4. cm_RestoreSelection
Selection is not restored! If, for example, you just copy/paste some text instead of p.3, selection is restored normally.
1. cm_SaveSelection
2. cm_ClearAll
3. cm_CopyNamesToClip
4. cm_RestoreSelection
Selection is not restored! If, for example, you just copy/paste some text instead of p.3, selection is restored normally.
- StickyNomad
- Power Member
- Posts: 1933
- Joined: 2004-01-10, 00:15 UTC
- Location: Germany
- ghisler(Author)
- Site Admin
- Posts: 48093
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Some file operations perform an autmoatic cm_saveselection, so you will be restoring this instead of the manually saved selection.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
1. so, in my caseghisler(Author) wrote:Some file operations perform an autmoatic cm_saveselection, so you will be restoring this instead of the manually saved selection.
cm_copynamestoclip causes a blank selection (nothing) to be saved? just can't understand why.
2. i don't wanna lose
selection and saving it to file (as it is now) is not convenient (e.g. in case of automating with ahk). maybe silent saving to default file?
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Try this:
http://ppro.totalcmd.net/Scripts/ClipFileList.htm
and
http://ppro.totalcmd.net/Scripts/ClipListDialog.htm
http://ppro.totalcmd.net/Scripts/ClipFileList.htm
and
http://ppro.totalcmd.net/Scripts/ClipListDialog.htm
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
1. thanks. i've read it briefly and what i can say now that problem is not copying, one is restoring selection to file panel. any advice?Vochomurka wrote:Try this:
http://ppro.totalcmd.net/Scripts/ClipFileList.htm
and
http://ppro.totalcmd.net/Scripts/ClipListDialog.htm
2. (little OT) maybe someone tell me how can i get file/dir name which is under cursor even some others are selected?
- StickyNomad
- Power Member
- Posts: 1933
- Joined: 2004-01-10, 00:15 UTC
- Location: Germany
When you press CTRL+SHIFT+ENTER, the filename with the cursor on it is copied to the command line. Then you can press CURSOR Left/right to have the command line activated and the text selected. Copy it and you're set. Maybe this helps you.2. (little OT) maybe someone tell me how can i get file/dir name which is under cursor even some others are selected?
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
It can be done with scripts. In brief, you get the listbox handle, then the current cursor position can be retreived. Next, you list all files in dir and get the item with the same number. Although there are some problems. For ex., this would hardly work in listbox after search. Second, the sorting order in both lists must be the same.Jungle wrote:maybe someone tell me how can i get file/dir name which is under cursor even some others are selected?
What about pressing Ctrl+T? The same dir opens without selection. You point the file you need and that's all.
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
1. i can get current index, but i can't get its text. could you provide me with aVochomurka wrote:It can be done with scripts. In brief, you get the listbox handle, then the current cursor position can be retreived.
working example (for TC), please?
2. i can use CTRL+T but i need to keep selection.
3. i've just thought of copying to comm. line. will try.
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Sorry, I can tell you about PowerPro only. If you have PowerPro installed, go to the \plugins\ subfolder and read 'file.txt' file - you need 'listfiles' function. It returns the list of all files in dir specified.Jungle wrote:1. i can get current index, but i can't get its text. could you provide me with a working example (for TC), please?
About examples. Please visit my page with PowerPro scripts for TC (link below any my post). There are A LOT of scripts that use 'listfiles' function. For example, http://ppro.totalcmd.net/Scripts/SubDirList.htm
What's the problem? You have two tabs with the same dir - first contains your selection, second has no selection, so you can put cursor on any file and execute either an internal TC command or a script to copy single file name to the clipboard. Do you understand me?2. i can use CTRL+T but i need to keep selection.
It can be only useful to learn the current directory. Am I right?3. i've just thought of copying to comm. line. will try.
Last edited by Vochomurka on 2006-01-30, 22:49 UTC, edited 1 time in total.
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
- StickyNomad
- Power Member
- Posts: 1933
- Joined: 2004-01-10, 00:15 UTC
- Location: Germany
2Vochomurka
Yes you are, but as Jungle stated two posts above, he was looking for a possibility to...It can be only useful to learn the current directory. Am I right?
Maybe you have overseen this one.2. (little OT) maybe someone tell me how can i get file/dir name which is under cursor even some others are selected?
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
2StickyNomad
Not really. There are many ways to get the current directory name (I know four of them ). But what is a problem is to get the current file name if other files are selected. I have no ready solution. But the one proposed by you is promising...Maybe you have overseen this one.
Last edited by Vochomurka on 2006-01-30, 22:52 UTC, edited 1 time in total.
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
Jungle,
HTH
Roman
I solved it this way:2. i don't wanna lose
selection and saving it to file (as it is now) is not convenient (e.g. in case of automating with ahk).
Code: Select all
ClipboardBackup = %ClipboardAll%
; cm_CopyNamesToClip
PostMessage, 1075, 2017
SelBackup = %ClipboardAll%
; cm_ClearAll
PostMessage, 1075, 524
; cm_CopyNamesToClip
PostMessage, 1075, 2017
DoThisAndThatWithNameUnderCursor(NowInClipboard)
Clipboard = %SelBackup%
SelBackup =
; cm_LoadSelectionFromClip
PostMessage, 1075, 2033
Clipboard = %ClipboardBackup%
ClipboardBackup =
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.