I've just released this integration script that copies file's contents to the clipboard when clicking a button:
http://totalcmd.net/plugring/CopyContents.html
As the publications in totalcmd.net allow us to provide a forum discussion topic, I'm creating this here as a communication channel.
Copy file contents to the clipboard
Moderators: white, Hacker, petermad, Stefan2
Re: Copy file contents to the clipboard
2pplupo
In the description on totalcmd.net you write:
In the description on totalcmd.net you write:
But you also suggest the following use:Script to be used as a button to copy the contents of the target file to the clipboard.
If you use %P%N - would it not be more correct to call it the source file? Otherwise yiu should suggest to use %T%MCommand: "\Copy File Contents.bat"
Parameters: %P%N
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Copy file contents to the clipboard
Good job PePe, specially because all is exposed in gitlab.
To make your script easier to use, you should create small snippet file/readme to create user command instead of button as it can be used as an alias or in a key shortcut.
If you want to use button, then the easier is to use the export from the button itself.
To make your script easier to use, you should create small snippet file/readme to create user command instead of button as it can be used as an alias or in a key shortcut.
If you want to use button, then the easier is to use the export from the button itself.
Re: Copy file contents to the clipboard
You are right. And actually, I've just tried with %S and it works, so it will work on any panel. I've updated it there already. Thank you very much.petermad wrote: ↑2021-05-19, 01:17 UTC 2pplupo
In the description on totalcmd.net you write:But you also suggest the following use:Script to be used as a button to copy the contents of the target file to the clipboard.If you use %P%N - would it not be more correct to call it the source file? Otherwise yiu should suggest to use %T%MCommand: "\Copy File Contents.bat"
Parameters: %P%N
Re: Copy file contents to the clipboard
Thanks!nsp wrote: ↑2021-05-19, 06:11 UTC Good job PePe, specially because all is exposed in gitlab.
To make your script easier to use, you should create small snippet file/readme to create user command instead of button as it can be used as an alias or in a key shortcut.
If you want to use button, then the easier is to use the export from the button itself.
![Smile :-)](./images/smilies/icon_smile.gif)
I'd love to learn how to do those (user command and export the button). Do you have references?
![Smile :-)](./images/smilies/icon_smile.gif)
Re: Copy file contents to the clipboard
To export a button just right click the button and choose: "Copy"I'd love to learn how to do those (user command and export the button).
You can then paste the code for the button to a text file.
When you want to make a copy of the button, you just do the reverse - select the pasted text, right click on the button bar and choose "Paste"
User commands you find in the file usercmd.ini file (in the same folder as your wincmd.ini file). You can either edit it manually or you can use the "Choose Command" dialog opened by the cm_CommandBrowser command - here you go down to the section usercmd.ini near the button - when you click on that buttons for making New user commands or Edit existing ones will appear.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Copy file contents to the clipboard
@petermad, thank you!!!petermad wrote: ↑2021-05-19, 19:10 UTCTo export a button just right click the button and choose: "Copy"I'd love to learn how to do those (user command and export the button).
You can then paste the code for the button to a text file.
When you want to make a copy of the button, you just do the reverse - select the pasted text, right click on the button bar and choose "Paste"
User commands you find in the file usercmd.ini file (in the same folder as your wincmd.ini file). You can either edit it manually or you can use the "Choose Command" dialog opened by the cm_CommandBrowser command - here you go down to the section usercmd.ini near the button - when you click on that buttons for making New user commands or Edit existing ones will appear.