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

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

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

Post 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



 
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Last edited by Fla$her on 2023-07-27, 13:54 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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?
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
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

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

Post 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.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

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

Post 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.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

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

Post 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).



 
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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.
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
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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.
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
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

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

Post 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
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

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

Post 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".
Overquoting is evil! 👎
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

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

Post 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.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post by *petermad »

Fla$her wrote:No, what makes you think that?
Your use of the word "but" - as "in contrary" in your statement.
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
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

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

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