Page 1 of 1

Copy names ONLY FOR SELECTED files to clipboard.

Posted: 2023-05-19, 20:34 UTC
by LonerD
Suggestion - copy names only for selected (marked) files to clipboard.
No selection = empty clipboard (and no errors).

It can be separate commands. Or parameters like
cm_CopyNamesToClip 1
cm_CopyFullNamesToClip 1
cm_CopyNetNamesToClip 1

Three files selected - copy their names to clipboard
Image: https://i.imgur.com/hsbHhqG.png

Single file selected - copy name to clipboard
Image: https://i.imgur.com/H63qUXG.png

No selection, just cursor on the first file - copy nothing (empty clipboard)
Image: https://i.imgur.com/5pMiPzP.png

No selection, just cursor on [..] - copy nothing (empty clipboard). WITHOUT any errors
Image: https://i.imgur.com/5pMiPzP.png

Re: Copy names ONLY FOR SELECTED files to clipboard.

Posted: 2023-05-19, 22:22 UTC
by Fla$her
You're confusing highlighting and selection.
I can offer such a solution with TCFS2:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef if(msg(1074,msg(1074,1000)+1004),tcm(2017))
%S1:~,0%Z
wciconex.dll,202
Copy names if highlighted
Instead of 2017 for full or net names, specify 2018 or 2021, respectively.

Re: Copy names ONLY FOR SELECTED files to clipboard.

Posted: 2023-05-19, 23:57 UTC
by LonerD
Fla$her wrote: 2023-05-19, 22:22 UTC You're confusing highlighting and selection.
TC documentation have only phrases like "selected file|files" or "file under cursor" (and no "highlighting" in relation to selection).
Fla$her wrote: 2023-05-19, 22:22 UTC I can offer such a solution with TCFS2
Thanks. I'll try to understand this magic with TCFS2.
Can you write this code on AutoHotkey?

But native implementation without %S parameter will be preferred.

Re: Copy names ONLY FOR SELECTED files to clipboard.

Posted: 2023-05-20, 00:40 UTC
by Fla$her
LonerD wrote: 2023-05-19, 23:57 UTCTC documentation have only phrases like "selected file|files" or "file under cursor" (and no "highlighting" in relation to selection).
I understand, but highlighting is optional for selection:
ghisler(Author) wrote: 2013-06-17, 09:04 UTCThe file under the cursor is treated as selected when nothing else is selected.

LonerD wrote: 2023-05-19, 23:57 UTCCan you write this code on AutoHotkey?

Code: Select all

; Parameters: %S1:~,0%Z

#NoTrayIcon
#IfWinActive, ahk_class TTOTAL_CMD
SendMessage, 1074, 1000,,, A
SendMessage, 1074, ErrorLevel+1004,,, A
If ErrorLevel
PostMessage, 1075, 2017,,, A
LonerD wrote: 2023-05-19, 23:57 UTCwithout %S parameter
Don't confuse %S and %S1:~,0, which is needed only for pre-deselection from [..].

LonerD wrote: 2023-05-19, 23:57 UTCBut native implementation will be preferred.
In this case, this should apply to all name copy commands, including these:

cm_CopyPathOfFilesToClip
cm_CopyFileDetailsToClip
cm_CopyFpFileDetailsToClip
cm_CopyNetFileDetailsToClip
cm_CopyHdrFileDetailsToClip
cm_CopyHdrFpFileDetailsToClip
cm_CopyHdrNetFileDetailsToClip