trek
February 20, 2019, 10:56am
1
Hi,
I use Files 2 Folder that is a right-click shell extension that will automatically create a folder based on the selected filenames and move that files into that folder. It works well when I select only files or only folders but when I select both I don't have that option in the context menu. I don't have this problem with Explorer
You can do this natively with Opus. The following command works for me:
@nodeselect
Rename REGEXP PATTERN="(.*)\.(.*)" TO="\1\\\1.\2"
lxp
February 20, 2019, 12:35pm
3
@trek :
Looks like the extension uses a non-standard way to register itself in the context menu. Using it from Explorer is fine, doing so from Opus feels a bit like blasphemy
@blueroly :
The extension does a bit more:
So a button would need to be a bit more advanced, depending on trek's needs. (btw: the Rename would not work for folders)
I couldn't install it, I've had my admin rights removed at work
All this can be easily accomplished with Opus (without the dialog) though. Shout if you need help.
Only thing that is different is the "set" option for the date format but that can be easily adjusted to suit your preferred date format.
@lxp I realised the code doesn't work on folders but based on the application name "Files2Folders" I presumed this wasn't required!
trek
February 20, 2019, 3:08pm
5
Thanks to all
This solution doesn't feet exactly my needs, because it creates a new folder for every selected file
Please, help me to create a context menu like your second post.
Also a button could be a good solution.
If you know how to do it, please, tell me how
Copy this code and paste it onto a toolbar when you are in customise mode.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none" type="menu">
<label>Files2Folder</label>
<icon1>#newmenu</icon1>
<button backcol="none" display="label" textcol="none">
<label>Move all selected items into a subfolder named:</label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>Copy MOVE HERE CREATEFOLDER</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label>Move each file into individual subfolders based on their names</label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>Rename REGEXP PATTERN="(.*)\.(.*)" TO="\1\\\1.\2"</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label>Move each file to subfolders based on their file extensions</label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>Rename REGEXP PATTERN="(.*)\.(.*)" TO="\2\\\1.\2"</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label>Move all selected items to a date folder named:</label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>Copy MOVE HERE CREATEFOLDER="{date|yyyy-MM-dd}"</instruction>
</function>
</button>
</button>
I haven't got time right now to go through the process of adding it to the context menu but will do later if you need it.
1 Like
That's what Files2Folder does judging by the red text on your screenshot?
trek
February 20, 2019, 3:42pm
8
Thanks, really really useful
If you have time, please, tell me how to do also context menu
Sorry, I don't understand what you mean: my english is very basic
I didn't post any screenshot
Go into customise mode: Settings / Customise
Copy the code I posted above then right click on a blank area of the toolbar and select paste. Click OK on the customise dialog and the button should appear on your toolbar.
Apologies, it was lxp who posted the screenshot.
1 Like