Copy names ONLY FOR SELECTED files to clipboard.

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka/Makiivka
Contact:

Copy names ONLY FOR SELECTED files to clipboard.

Post 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
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
Fla$her
Power Member
Power Member
Posts: 2388
Joined: 2020-01-18, 04:03 UTC

Re: Copy names ONLY FOR SELECTED files to clipboard.

Post 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.
Last edited by Fla$her on 2023-05-20, 07:04 UTC, edited 2 times in total.
Overquoting is evil! 👎
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka/Makiivka
Contact:

Re: Copy names ONLY FOR SELECTED files to clipboard.

Post 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.
Last edited by LonerD on 2023-05-20, 00:40 UTC, edited 1 time in total.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
Fla$her
Power Member
Power Member
Posts: 2388
Joined: 2020-01-18, 04:03 UTC

Re: Copy names ONLY FOR SELECTED files to clipboard.

Post 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
Overquoting is evil! 👎
Post Reply