GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Copy file or folder name only in to clipboard ignor extension etc

I have some folder like
Folder. artist A [mixed]
Folder. artist B (mixed)

I have some files like
file. artist A (1).flac
file. artist B [remixed].mp4

I need a button for copy the folders and files names only into the clipboard but Ignore all kinds of extension and Ignore everything what is inside in first bracket () and second bracket [] in files and folder names.

Expected Result in folder name is
Folder. artist A
Folder. artist B

Expected Result in folder name is
file. artist A
file. artist B

Hay Dear Community, please help me!

Please Help me someone!!

Dear Community, please help me!

Copy no ext.dcf (304 Bytes)

Clipboard COPYNAMES REGEX "(.+)\.+" "\1"

Is this what you want to do? Let me know... the community is here or you.

Thanks Dear pctechtv for helping me. But This button Copy All the folder path also what I don't want, I want only file or folder names.

Example 1 for FOLDER NAME: "Folder Name A [Demo]" is a folder and it's location is:
D:\Project Secure\Backup v.1 [03-11-2018]\Folder Name A [Demo]
What This button Does :
D:\Project Secure\Backup v.1 [03-11-2018]\Folder Name A
What I want as the result is:
Folder Name A

Example 2 for File NAME: "File Name A [Demo].mp3" is a File and it's location is:
D:\Project Secure\Backup v.1 [03-11-2018]\Folder Name A [Demo]\File Name A [Demo].mp3
What This button Does :
D:\Project Secure\Backup v.1 [03-11-2018]\Folder Name A [Demo]\File Name A [Demo]
See All The path is copied.
What I want as the result is:
File Name A

OK... try this one. Let me know...

Copy N bp.dcf (311 Bytes)

Clipboard COPYNAMES REGEX "(.+)\[|\(.+\]|\)" "\1"

Thank you again Dear pctechtv. here is you feedback.

Feedback 1 for Folder Name:
original path is:
D:\Project Secure\Backup v.1 [03-11-2018]\Folder name A [test]
what the button does:
D:\Project Secure\Backup v.1 [03-11-2018]\Folder name A
What I want is: Folder name A

Feedback 2 for Files Name:
original path is:
D:\Project Secure\Backup v.1 [03-11-2018]\Folder name A [test]\File name A [test] - demo.txt
what the button does:
D:\Project Secure\Backup v.1 [03-11-2018]\Folder name A [test]\File name A
What I want is: File name A

If you don't want the paths, you can remove them easily.

Clipboard COPYNAMES copies the full paths to the clipboard.

Clipboard COPYNAMES=nopaths copies just the names to the clipboard.

The REGEX ... stuff in the two commands above will work with both, so you can put that on the end of the command.

e.g. If you think the last regex in the thread was the right one, then this will do the same thing but without the paths:

Clipboard COPYNAMES=nopaths REGEX "(.+)\[|\(.+\]|\)" "\1"

While regex takes a little time to learn & understand, things like the nopaths parameter are all in the manual and easy to learn/use. :slight_smile:

Thanks Leo for helping...
I use this code: Clipboard COPYNAMES=nopaths REGEX "(.+)\[|\(.+\]|\)" "\1"

but the result is not as expected.
What the button dose: "file name A (test).txt"
What I want as result is: "file name A"

Try this:

Clipboard COPYNAMES=nopaths REGEXP "(.+)\(|\[.+\)|\]" "\1"

Dear Jon I try your code, But your code is not work also. its paste the whole code line only.
what the button does: Clipboard COPYNAMES=nopaths REGEXP "(.+)\(|\[.+\)|\]" "\1"
What I want as result is: "file name A"

That's what I get when I try it here.