Script to right click a file then auto create & move to folder of that file name?

Hi,

I am wondering if it is possible to do this with script:-
For example, there is a file with the name "paper.doc". I want to move it to a folder named "paper".
Under normal condition, i need to create a folder, rename it to "paper", then drag the paper.doc into that new folder. If there is already a lot of files and folders in that parent folder, it is troublesome to locate the file and drag to the new folder.

How to simplify those steps by right click to paper.doc, then an option to select "send to paper folder" ? It will auto create a new folder with the same name as file name (without extension) and move into that new folder. When multiple files are selected, the file that is right-clicked will become the folder name. This will help in organizing files.

When we use 7zip to unzip files, it can unzip into a new folder using the file name. same concept i am looking for normal file(s).

Thanks.

Here's the command that will do that:

Copy MOVE HERE CREATEFOLDER={file|noext}

You can add it to the All Files context menu under Settings > File Types. When creating the new context menu item, set the type to "Run an Opus function" and paste that as the command.

Yes thanks it works. I think i need another script for multiple files selection. Above script will send each file to each folder by their names.
Is there a way to group them into same folder where after multiple selection, the particular file is "right-clicked" will become the folder name. This is useful when selecting files like photo01.jpg, photo02.jpg, photo03.jpg kind of situation.

Quick buttons for directory organisation - Buttons/Scripts - Directory Opus Resource Centre (dopus.com)

I don't think this info is available, not even in a script.

You could feed the filenames to a dropdown (might get long) or move to files to a dummy folder and rename it in a second step.

Yes, like this:

@set dir={file|noext}
Copy MOVE HERE CREATEFOLDER="{$dir}"

(The file you right-click will always be the first one in the list, which is why it works.)

2 Likes

Need to correct myself: a script could use GetFocusItem() to get the right-clicked item.

Tab

Wow that works! Opus is powerful, just that many functions are not known or used by regular users.

For the default right click "Command Prompt Here", how to change it to admin level?

Copy the command from the default toolbars:

(Please start a new thread for new questions. Helps other people find answers to the same thing.)