GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Create folder name from parent name + 'Covers'

I have a folder named 'Test Album Name. Artist. Name'
In this folder name I use 2 Full Stop sign.
so there is Three part in this folder name. Before first full stop, and After Last full stop. Before first full stop part is my album name and after 2nd full stop part is artist name. I want to create a folder inside the folder 'Test Album Name. Artist. Name' with the text of Before First full stop then space then 'Covers'

how I do the same job now?
now I select the folder press F2 for rename mode,
Select the text 'Test Album Name',
Press Ctrl+C for Copy the text 'Test Album Name'
Press Enter for exit rename mode
Press Enter for open the folder 'Test Album Name. Artist Name'
Press Ctrl+N for create new folder
Press Ctrl+V for paste the Clipboard text 'Test Album Name'
Press Spacebar then type 'Covers'
Press Enter

Add this to your toolbar (See Button .dcf Files in How to use buttons and scripts from this forum):

Go to the folder where you want to create the Covers folder:

Click the button:

Script code for reference:

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.ClearFiles();
	cmd.deselect = false;

	var folderName = clickData.func.sourcetab.path.filepart;

	var matches = folderName.match(/^[^.]+/);
	DOpus.Output(matches.length);
	if (matches.length != 1) { return; }

	var newName = matches[0] + ' Covers';
	cmd.RunCommand('CreateFolder NAME="' + newName + '"');
}

This is exactly what I want. 100% Work for me. Thank you so much Leo. Love for Directory Opus developer team.

Hi Dear Leo, I need a little work more with this button, Now I Click this button & a Folder will create by that, then I have to open that folder by pressing Enter from my keyboard.
I need automatically open the new created folder also, is That possible?

Change the 2nd last line to:

    cmd.RunCommand('CreateFolder NAME="' + newName + '" READAUTO');

Thanks