Page 2 of 3

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 08:49 UTC
by Stefan2
To add:

with TC-parameter and a AHK-script we also can do both in one command:
- copy clipboard content (new name) to a variable
- copy selected file name to clipboard (or to a temp file)
- modify the string in the var (remove line breaks and such)
- rename copied file name with content from the var



 

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 09:05 UTC
by Fla$her
ghisler(Author) wrote: 2023-07-27, 08:01 UTC I don't handle Ctrl+V in any edit boxes, this is handled by Windows itself.
As far as I understand, modern browsers in the address bar don't handle Ctrl+V, but inserting text into the field, which can be done through the context menu with the "Paste" item. Try it yourself.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 10:20 UTC
by petermad
As far as I understand, modern browsers in the address bar don't handle Ctrl+V
I have no problem using Ctrl+V for filling out the address bar in Microsoft Edge, Google Chrome or FireFox - but maybe those are not categorized as modern browsers?

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 10:44 UTC
by funkymonk
Stefan2 wrote: 2023-07-27, 08:23 UTC I myself always use the way via notepad (copy from web or document >> paste in notepad >> adjust the text >> copy and paste where I want to)
Sure, that's exactly how I do it as well. A quite slow option in a fast workflow (that TC supports with other functionality) ...

But that's fine, I can live with that.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 10:57 UTC
by Usher
2ghisler(Author)
What about implementing Ctrl+Shift+V feature?
Many apps (MS Office, Google Docs etc.) use this hotkey to paste selection as a plain text, without any formatting.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 10:58 UTC
by Stefan2
funkymonk wrote: 2023-07-27, 10:44 UTC
Stefan2 wrote: 2023-07-27, 08:23 UTC
A quite slow option
Yes, but in the meantime I am quite fast using Alt+Tab :D


and having an editor with scripting support (if need) :wink: , e.g. PsPad and EmEditor


I myself doesn't like file managers being that smart and doing things for me in the background, while hiding the truth.
If I have line breaks or such in the clipboard, than that is my own fault and I fix it on my own (IMHO).



 

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 10:59 UTC
by Fla$her
petermad wrote: 2023-07-27, 10:20 UTC I have no problem using Ctrl+V for filling out the address bar in Microsoft Edge, Google Chrome or FireFox - but maybe those are not categorized as modern browsers?
Did I write about any problems? You translated incorrectly, taking the phrase out of context.
It was assumed that Ctrl+V and insertion by selecting from the menu are handled the same way, i.e. they add text, and the addition itself is handled separately with the replacement of line breaks.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 11:12 UTC
by petermad
2Fla$her
Fla$her wrote:modern browsers in the address bar don't handle Ctrl+V, but pasting text into the field, which can be done through the context menu with the "Paste" item.
Here is how I read your statement: "You can not use Ctrl+V to paste text into the address bar of modern browsers, but you can paste text to the address bar via the context menu's "Paste" item".

And I reply, that I can use Ctrl+V for that, so I don't see your statement as a problem.

Please rephrase/elaborate your original statement if it doesn't mean that Ctrl+V cannot be used to paste text into the address bar of modern browsers.


Fla$her wrote:It was assumed that Ctrl+V and insertion by selecting from the menu are handled the same way
If I paste copied text with line breaks in for example Edge's address bar, it is inserted the same way whether I use Ctrl+V or the context menu - the line breaks are converted to spaces - so apparently that assumption is correct.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 12:01 UTC
by Fla$her
petermad wrote: 2023-07-27, 11:12 UTCHere is how I read your statement:
Incorrectly, you confuse the opposition of a verb and a noun.
petermad wrote: 2023-07-27, 11:12 UTCPlease rephrase/elaborate your original statement
I can describe it in a little more detail:
As far as I understand, modern browsers in the address bar, when replacing characters, don't handle pressing Ctrl+V itself, but inserting text into the field, which (in addition to the hotkey) can be called from the context menu by the "Paste" item.

petermad wrote: 2023-07-27, 11:12 UTCso apparently that assumption is correct.
Apparently so.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 13:17 UTC
by petermad
2Fla$her
modern browsers in the address bar, when replacing characters, don't handle pressing Ctrl+V itself, but inserting text into the field
So you mean that modern browsers inserts the spaces by using the same function as the context menu uses, and that the function of the context menu is different from the Ctrl+V function itself (even though the item in the context menu is labelled: "Paste Ctrl+V")?

If that is the case, I would have understood it better, if you in stead of:
modern browsers in the address bar don't handle Ctrl+V, but pasting text into the field...
had written:
"modern browsers in the address bar don't handle Ctrl+V, but are pasting text into the field..."
or
"modern browsers in the address bar don't handle Ctrl+V, but pastes text into the field...."

Pasting as a noun means: "a severe beating, severe criticism, or a severe defeat in a game or competition"
Pasting as a present participle needs to be preceded by for example are, were, have been, had been, will be etc.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 13:21 UTC
by funkymonk
Stefan2 wrote: 2023-07-27, 10:58 UTC I myself doesn't like file managers being that smart and doing things for me in the background, while hiding the truth.
If I have line breaks or such in the clipboard, than that is my own fault and I fix it on my own (IMHO).
I can totally relate to that. Still: It's always about finding a reasonable trade-off between manual work and automation... :D

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 13:54 UTC
by Fla$her
2petermad
So you mean that modern browsers inserts the spaces by using the same function as the context menu uses
Yes.
and that the function of the context menu is different from the Ctrl+V function itself
No, what makes you think that?
If that is the case, I would have understood it better, if you in stead of:
Wrong. It's incorrect to equate the insertion handling with the insertion itself. It's not pressing that is handled, but inserting text. That's what I have written.

"pasting" corrected to "inserting".

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 16:22 UTC
by hi5
Just in case you need it now and often, consider a clipboard manager that allows you to do a "paste special" which would do this for you - or a simple AutoHotkey script - so you not only have it in TC but also in "save as" dialogs.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-27, 20:50 UTC
by petermad
Fla$her wrote:No, what makes you think that?
Your use of the word "but" - as "in contrary" in your statement.

Re: Using clipboard to paste text as file name: replace newline by space

Posted: 2023-07-28, 02:36 UTC
by Fla$her
petermad wrote: 2023-07-27, 20:50 UTCYour use of the word "but" - as "in contrary" in your statement.
But I write about the context menu only in an additional clarification after "which (in addition to the hotkey) can be ...", not "but". There is no functional contraposition to the result of using a hotkey.

Below is an automatic translation from Danish to English:
Det er ikke at trykke på genvejstasten, der håndteres, men indsætte tekst.
It is not pressing the hotkey that is handled, but inserting text.