How to...add prefix when copying names of selected files to clipboard?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Online
MBaas
Posts: 578
Joined: 15 Feb 2016 21:08

How to...add prefix when copying names of selected files to clipboard?

Post by MBaas »

Argh - I was just about to do my usual manual routine wen it dawned on me that this surely could be done much better with XY's tools! :oops: But I'm afraid I still don't know much about scripting. :oops:

What I'd like to do is...
- select a few files in current dir (manually, before calling script)
- copy the names to clipboard and add a constant prefix ("copy=") to them.

Can some kind soul pls. give me a headstart or point out compareable scripts somewhere? :wink:
______________________________________________
Happy user ;-)

highend
Posts: 13315
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to...add prefix when copying names of selected files to clipboard?

Post by highend »

And what exactly is so difficult about that?

copytext regexreplace(<get SelectedItemsNames <crlf>>, "^(.)", "<some prefix>$1");
And if you don't want to learn regex, learn to use a loop...
One of my scripts helped you out? Please donate via Paypal

Online
MBaas
Posts: 578
Joined: 15 Feb 2016 21:08

Re: How to...add prefix when copying names of selected files to clipboard?

Post by MBaas »

Well, I tried once or twice with some success - but the nr of commands feels overwhelming and I never give myself enough time to go through them in detail. Entirely my fault, I admit - but there's so much to do...

But rx I know - so this is very useful. Works like charm. What a timesaver! Thanks a million! :appl: :appl:
______________________________________________
Happy user ;-)

Post Reply