Clipboard parameter for button bars

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

KozakMak
Senior Member
Senior Member
Posts: 478
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: Clipboard parameter for button bars

Post by *KozakMak »

2ghisler(Author)
and for
Horst.Epp wrote: 2024-11-04, 14:56 UTC Very nice, so I can remove Nirsoft form many buttons.
commands like: *powershell.exe should not require full path 8)
OS: Win10 | TC: latest x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Clipboard parameter for button bars

Post by *Horst.Epp »

KozakMak wrote: 2024-11-04, 15:35 UTC 2ghisler(Author)
and for
Horst.Epp wrote: 2024-11-04, 14:56 UTC Very nice, so I can remove Nirsoft form many buttons.
commands like: *powershell.exe should not require full path 8)
I also use PowerShell, but why should I take a script when TC provides a native function.
How fits the color setting into the title of this thread ?
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Clipboard parameter for button bars

Post by *Fla$her »

ghisler(Author) wrote: 2024-11-04, 10:38 UTC What do you think?
The right move! Please remove all extreme whitespace characters, as well as exclude empty strings from the search for a string by number.

2browny
Well, what? Is this still nonsense for you? Of course, I don't expect an apology...
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Clipboard parameter for button bars

Post by *ghisler(Author) »

Please remove all extreme whitespace characters
What do you mean with extreme? Tabstops?
exclude empty strings from the search for a string by number
Is that really a good idea? For example, when copying a button to the clipboard, empty lines are placeholders for empty fields, so ignoring them would assign the wrong values.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Clipboard parameter for button bars

Post by *Fla$her »

ghisler(Author) wrote: 2024-11-05, 08:27 UTC What do you mean with extreme? Tabstops?
No. All the topmost/lowest/leftmost/rightmost.
ghisler(Author) wrote: 2024-11-05, 08:27 UTC Is that really a good idea? For example, when copying a button to the clipboard, empty lines are placeholders for empty fields, so ignoring them would assign the wrong values.
If it were a text file (like "%FL" here) rather than a clipboard, I would agree. But very often (in the same browser) lines are selected in bulk, where there are a lot of unnecessary empty lines, and there is no desire to count them. It is much easier to count the filled lines.
Overquoting is evil! 👎
User avatar
xxxdo1
Junior Member
Junior Member
Posts: 87
Joined: 2024-11-03, 02:45 UTC

Re: Clipboard parameter for button bars

Post by *xxxdo1 »

Looking forward to the next beta version, :D
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Clipboard parameter for button bars

Post by *ghisler(Author) »

No. All the topmost/lowest/leftmost/rightmost.
Topmost what? Windows? Files? I don't get you at all.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Clipboard parameter for button bars

Post by *Fla$her »

You quoted it yourself:
ghisler(Author) wrote: 2024-11-05, 08:27 UTC
Please remove all extreme whitespace characters
=
Please remove all topmost/lowest/leftmost/rightmost whitespace characters
Take 'edge' instead of 'extreme'.

Code: Select all



	       string1
  string2  
	string3	

string4        			


>>>

Code: Select all

string1
  string2  
	string3	

string4
For one:

Code: Select all

         	string	         
>>>

Code: Select all

string
Full trim(), in short.
Overquoting is evil! 👎
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Clipboard parameter for button bars

Post by *Fla$her »

04.11.24 Added: New pseudo environment variable %$CLIPNAME1%, %$CLIPNAME2% etc.: Inserts line 1, line 2 etc. from clipboard, characters replaced like with $CLIPNAME, removes leading and trailing spaces (32/64)
04.11.24 Added: New pseudo environment variable %$CLIPNAME0%: Same as %$CLIPNAME%, but replaces line breaks with spaces (32/64)
04.11.24 Added: New pseudo environment variable %$CLIPNAME% inserts up to 8191 characters from clipboard, replaces forbidden characters *?|<> with underscores_ (32/64)
04.11.24 Added: New pseudo environment variable %$CLIPBOARD1%, %$CLIPBOARD2% etc.: Inserts line 1, line 2 etc. from clipboard, otherwise unmodified (32/64)
04.11.24 Added: New pseudo environment variable %$CLIPBOARD0%: Same as %$CLIPBOARD%, but replaces line breaks with spaces (32/64)
04.11.24 Added: New pseudo environment variable %$CLIPBOARD% inserts up to 8191 unmodified characters from the clipboard (32/64)
2ghisler(Author)
Thanks for the additions!
But you didn't do exactly what I asked you to do. It's necessary to delete line breaks. Replacing with spaces only spoils everything.

Code: Select all

        
   
   text   

     
%$CLIPBOARD0% should give 'text' rather than

Code: Select all

'       text          '
And

Code: Select all

        
   
   string1   
   string2   
     
should give

Code: Select all

string1   
   string2
Also, deleting all edge blank lines should also apply to %$CLIPNAME1%, %$CLIPNAME2%:

Code: Select all

        
   
   Name 1   

     Name 2     

Name 3    


%$CLIPNAME1%=Name 1
%$CLIPNAME2%=Name 2
%$CLIPNAME3%=Name 3

Otherwise, empty string will return instead of text.
Overquoting is evil! 👎
browny
Senior Member
Senior Member
Posts: 359
Joined: 2007-09-10, 13:19 UTC

Re: Clipboard parameter for button bars

Post by *browny »

04.11.24 Added: New pseudo environment variable %$CLIPBOARD% inserts up to 8191 unmodified characters from the clipboard (32/64)
Unicode characters or just bytes?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Clipboard parameter for button bars

Post by *ghisler(Author) »

2browny
Unicode characters.

2Fla$her
But you didn't do exactly what I asked you to do. It's necessary to delete line breaks. Replacing with spaces only spoils everything.
I don't get it. The idea is when you use e.g. menu Mark - "Copy names with path to clipboard" to generate a valid command line with all the names after each other. That's why it's called %$CLIPNAME0%.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Clipboard parameter for button bars

Post by *Fla$her »

2ghisler(Author)
The idea is when you use e.g. menu Mark - "Copy names with path to clipboard" to generate a valid command line with all the names after each other.
How can you get a valid command line with a bunch of extra spaces?
And what's the point if it doesn't follow the %S rules when names with spaces are enclosed in quotation marks? If they are present, the command will not work properly. And in general, it's unclear why use a command like cm_CopyNamesToClip if there is %S/%R? It's a strange idea. More often, working with the clipboard takes place in a browser or some kind of editor.
What I want is primarily related to getting the correct name, where there should be no empty string instead of the name, as well as extra spaces at the beginning and end of the resulting value, since this is meaningless and useless for the user. I have given you examples.
That's why it's called %$CLIPNAMES0%.
Such a command is not declared in history. I tried it and it returns the same as %$CLIPBOARD%.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Clipboard parameter for button bars

Post by *ghisler(Author) »

How can you get a valid command line with a bunch of extra spaces?
Normally parameters are separated by spaces.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Clipboard parameter for button bars

Post by *Fla$her »

ghisler(Author) wrote: 2024-11-07, 15:55 UTC Normally parameters are separated by spaces.
Once again, this is not normal:

Code: Select all

'       text          '
Just like an empty string.

How it should be ideally:
1. For $CLIPBOARD0, $CLIPNAMES0 and $CLIPNAME, all the outermost whitespace characters must be removed.
2. For $CLIPBOARD0 and $CLIPNAME (before addressing by number), double or more line breaks must be replaced with single ones.
3. Given 1 and 2, these variables should not return an empty string or an all-space string if the clipboard has non-whitespace characters.
4. For $CLIPNAMES0, line breaks (except for all top and bottom ones subject to deletion) will be replaced with single spaces.
5. $CLIPNAME0 should be replaced by $CLIPNAMES0.
Last edited by Fla$her on 2024-11-07, 22:05 UTC, edited 5 times in total.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Clipboard parameter for button bars

Post by *petermad »

Where does this %$CLIPNAMES0% with a $-sign before 0 come from? - it is not documented in neither the History nor the Help? And not herehttps://ghisler.ch/board/viewtopic.php?p=463078#p463078 either
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply