Page 2 of 3

Re: Clipboard parameter for button bars

Posted: 2024-11-04, 15:35 UTC
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)

Re: Clipboard parameter for button bars

Posted: 2024-11-04, 19:47 UTC
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 ?

Re: Clipboard parameter for button bars

Posted: 2024-11-04, 20:02 UTC
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...

Re: Clipboard parameter for button bars

Posted: 2024-11-05, 08:27 UTC
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.

Re: Clipboard parameter for button bars

Posted: 2024-11-05, 20:03 UTC
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.

Re: Clipboard parameter for button bars

Posted: 2024-11-06, 02:18 UTC
by xxxdo1
Looking forward to the next beta version, :D

Re: Clipboard parameter for button bars

Posted: 2024-11-06, 07:43 UTC
by ghisler(Author)
No. All the topmost/lowest/leftmost/rightmost.
Topmost what? Windows? Files? I don't get you at all.

Re: Clipboard parameter for button bars

Posted: 2024-11-06, 08:21 UTC
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.

Re: Clipboard parameter for button bars

Posted: 2024-11-06, 19:15 UTC
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.

Re: Clipboard parameter for button bars

Posted: 2024-11-06, 21:58 UTC
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?

Re: Clipboard parameter for button bars

Posted: 2024-11-07, 10:15 UTC
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%.

Re: Clipboard parameter for button bars

Posted: 2024-11-07, 11:38 UTC
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%.

Re: Clipboard parameter for button bars

Posted: 2024-11-07, 15:55 UTC
by ghisler(Author)
How can you get a valid command line with a bunch of extra spaces?
Normally parameters are separated by spaces.

Re: Clipboard parameter for button bars

Posted: 2024-11-07, 21:02 UTC
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.

Re: Clipboard parameter for button bars

Posted: 2024-11-07, 21:58 UTC
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