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$|..\..}
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'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).