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
MBaas
Posts: 243
Joined: 15 Feb 2016 21:08

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

Post by MBaas » 02 Apr 2019 13:26

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: 8304
Joined: 06 Feb 2011 00:33

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

Post by highend » 02 Apr 2019 14:16

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 or highend (at) web (dot) de

MBaas
Posts: 243
Joined: 15 Feb 2016 21:08

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

Post by MBaas » 02 Apr 2019 14:38

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