Page 1 of 1

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

Posted: 02 Apr 2019 13:26
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:

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

Posted: 02 Apr 2019 14:16
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...

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

Posted: 02 Apr 2019 14:38
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: