Help for button code [select specified folder]

I need a button that does this job:

1/ I select a file or folder (in source) and press the button so that it asks where (source or destination or parent) I want to create a new folder based on selection name. DONE
2/ If it's single display mode, set in dual display. DONE

3/ In destination panel, just select the new created folder.

Here is my actual code that does 2/3 of the job:

@nofilenamequoting @nodeselect @runonce:@set path={dlgchoose|Where?|Here={sourcepath}+Destination={destpath}+Parent={filepath$|..\..}} @runonce:@set NewFold={$path}{dlgstringS|Suggested name|{file|noext}} CreateFolder NAME "{$NewFold}" Go "{$NewFold}" OPENINDEST Set FOCUS=Toggle @useactivelister Go {filepath$|..\..}

Instead of selecting the new folder in destination panel, my code goes to the new path.
I can't make this part work.

Set FOCUS=Toggle @useactivelister Go {filepath$|..\..}

Need help. Maybe there is another way to do it.

See if this works. I've not tested it much but it seems okay.

@nofilenamequoting @nodeselect @runonce:@set NewPath={dlgchoose|Where?|Here={sourcepath$}+Destination={destpath}+Parent={filepath$|..\..}} @runonce:@set NewName={dlgstringS|Suggested name|{file$|noext}} CreateFolder NAME "{$NewPath}{$NewName}" Set DUAL=On FOCUS=Toggle dopusrt /cmd Go "{$NewPath}" dopusrt /cmd Select "{$NewName}"

Thanks you, Leo.

Strange that dopusrt /cmd must be used to work but it must.

I tried to make another button based on this pattern but it doesn't work. It has to ask where I want to copy file or folder, ask a new name for it and focus and select the new file in dest panel.

@nofilenamequoting @nodeselect @sync @firstfileonly @runonce:@set NewPath={dlgchoose|Where?|Here={sourcepath$}+Destination={destpath}+Parent={filepath$|..\..}} @runonce:@set NewName={dlgstringS|Suggested name|{file$|noext}} Copy AS "{$NewName}{file|ext}" to "{$NewPath}" Set FOCUS=dest (toggle doesn't work here, don't know why) dopusrt /cmd Select NONE dopusrt /cmd Select "{$NewName}"

I can't make this partdopusrt /cmd Select NONE dopusrt /cmd Select "{$NewName}"work.

I tried with this too

dopusrt /cmd Select NONE dopusrt /cmd Select {$NewName}

Ho, and I made this button that works very well

@nofilenamequoting @nodeselect @sync Set DUAL=On Clipboard COPYNAMES=nopaths Copy Set FOCUS=Toggle dopusrt /cmd Select NONE dopusrt /cmd Select "{clip}"

I don't understand the difference between this and the previous one.

I'm not sure. Making things happen in an inactive file display is all a bit voodoo, except for the things Opus explicitly supports doing (e.g. Go OPENINDEST). It's usually possible to find ways to make it but it often requires tricking Opus into running commands under a new context (which is what the "dopusrt /cmd" trick does).