Here is a simple button to move selected files to a new folder based on the name of the first selected file. The folder name can be changed after the move command if shift key is held down.
The second button was already posted somewhere on this forum and move all files to the parent directory and delete the folder.
<?xml version="1.0"?>
<button backcol="none" display="both" separate="yes" textcol="none" type="three_button">
<label>Déplacement Rapide</label>
<icon1>#opentoolbar</icon1>
<button display="both">
<label>Déplacer dans un dossier auto</label>
<tip>Déplacer dans un dossier du nom du fichier</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>@nofilenamequoting </instruction>
<instruction>@runonce @set Folder={file|noext}</instruction>
<instruction>@runonce CREATEFOLDER "{file|noext}"</instruction>
<instruction>Copy MOVE TO ".\{$Folder}"</instruction>
<instruction>@keydown:shift </instruction>
<instruction>Rename {$Folder}</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>Déplacer dans le dossier parent</label>
<tip>Déplacer les fichiers dans le dossier parent et supprimer le dossier counant</tip>
<icon1>#opentoolbar</icon1>
<function type="batch">
<instruction>@set ChildPath={sourcepath$|noterm}</instruction>
<instruction>@runmode hide</instruction>
<instruction>Copy MOVE * TO ..</instruction>
<instruction>Go ..</instruction>
<instruction>rmdir {$ChildPath}</instruction>
</function>
</button>
</button>
To put the commands on a context menu, paste the codes above on to a toolbar temporarily, then edit the buttons to get the commands out of them. You can then use the File Type editor and paste the same commands into new context menu items, using the Run an Opus Function type.
But anyway, instead of using the rename operation, I'd rather prefer to be able to:
instantly rename inline as a last step, once all the files are moved into the new created folder (so I don't have to hit F2 each time)
or
rename it once the folder is created, with the dialog below, just before the files are moved:
Ideally, I'd like to test both of these options, if possible.
Also, I tried with the command "Rename INLINE" instead of "Rename {$Folder}", but no success. I also tried by adding the sync command modifier, so "@sync:Rename INLINE", but still no success (I believe that I still don't know how to use it properly).