GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Select part of a filename and put it in copy buffer

Hey all,
I come seeking scripting (perhaps) help. I'd like to extract the date and time from screengrabs. They'll look like this:


and I'd like to select the:

bits and put the resulting text in the copy buffer. I will only be selecting one file at a time, I just have a couple selected here to show the exact part I want to select in files differently named to start with. I know I can copy a filename with Clipboard COPYNAMES=nopaths but I'm not sure how to extract the characters I need. Can I use Regex here?

Hope you're all well, and staying safe in Covid land...

All the best,


Can I use Regex here?


Clipboard COPYNAMES=nopaths REGEXP ".*\d\d\d\d-(\d\d-\d\d_\d\d-\d\d)-\d\d\..*" "\1"
1 Like

Well, that was a short thread! :smiley: Thank you lxp, your Regex worked perfectly.


1 Like