How to Open Newly created folder to the destination file display

I have a JavaScript Button

function OnClick(clickData){

	var cmd = clickData.func.command;
		cmd.deselect = false;

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

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

	var newName = matches[0] + ' Covers';

	cmd.RunCommand('Copy MOVE HERE CREATEFOLDER="' + newName + '"');


This Button Move Selected Files in to a newly Created folder Names from parent folder names part. I want to add some command which will Open that newly created folder in other display.

var path = clickData.func.sourcetab.path;
newFdr = path + "\\" + newName
cmd.RunCommand('Go "' + newFdr + '" NEWTAB=tofront OPENINDEST')


1 Like

Your Code works fine Thank you so much but need a little finetune I want to open that folder in a Newtab in destination file display. Please add Newtab argument with this code.

Looks like that was meant to be there originally, and got added in a later edit.

Now it's working as I wanted. Thanks you onece again dear brother.