Please could someone assist me with renaming files. What I am trying to do is move my movie collection into folders based on the filename.
For example,
Move1.avi -> Movie1\Movie1.avi
The problem I am having is I cannot understand the regular expressions or the commands correctly. I tried the standard rename using the {filename}{filename} as the target
But I end up with a folder called Movie1.avi.
How do I create a folder based on the filename without the .avi extension.
I think Albator's solution will work (I didn't test it - but he knows well)... But just so you know, you can [u]also[/u] do this quite easily with a simple hotkey or button that uses the Copy MOVE command, and not worry about regular expressions and the rename command. Here's the code for the button:
<?xml version="1.0"?>
<button display="both" icon_size="large" label_pos="right">
<label>Move to new Folder</label>
<tip>Move to new Folder</tip>
<icon1>#move</icon1>
<function type="normal">
<instruction>Copy MOVE HERE CREATEFOLDER {f|noext}</instruction>
</function>
</button>
hi all, thanks for these last commands who help me each days, i give you a challenge once again, i think that i will use "yOyO's challenge" as label for the future questions
So, i would like a button command near to this topic, there's how i would like it works: select multiple files, press the new command, it move all the files in a subfolder and a box appears and ask you the name of this folder but it already as the name of the first files (and the name is selected, like that we win time if we want to remove it by backspace) that's all
Ready, on your marks, get set, "Gopus" !!!
@nofilenamequoting
@runonce:@set dirname={dlgstringS|Enter name of folder to move selection into|{file$|noext}}
Copy MOVE HERE FILE="{file$}" CREATEFOLDER="{$dirname}"
Use the following code in a MS-DOS Batch Function button :
@nofilenamequoting
@nodeselect
@set strDir = {RS|Please enter your destination dir|{o|noext}}
CreateFolder "{d}{$strDir}"
Copy MOVE to "{d}{$strDir}"
Please remember that you should use a MS-DOS Batch Function button (see attached picture), because DOpus cannot set the value of {o} , {f}, etc. to a local variable in many cases (I really think this is a bad bug).
Should NOT need to set that code to an MS-DOS BATCH file mode... Have you notified GPSoft about specific cases where you've found the control codes not working properly when used to set variaboles? Either through the support page or here on the forums?
If not, can you start a new topic for it (NOT IN THIS THREAD)?
I haven't tried any of the other commands in this thread but this works with both context menus and buttons:
@nofilenamequoting
@runonce:@set dirname={dlgstringS|Enter name of folder to move selection into|{file$|noext}}
Copy MOVE HERE CREATEFOLDER="{$dirname}"
(Same thing that I posted before, except with the FILE="{file$}" argument removed. I'm not sure if that argument was ever needed in the first place but it's definitely not needed with Opus 9.1.1.5 now.)
This is a VERY handy function to have for organizing batches of files dumped into a single sub-directory. I tried just about everything previously posted in this thread and finally got a one-line script that works reliably:
@runonce dopusrt /cmd Copy MOVE TO HERE CreateFolder {file|noext}
This functions as a single-click toolbar command which creates a new sub-folder containing the selected files, named after the first file selected... no prompt for the folder name. I normally don't rename the folder right away, so this is truly a single click function. Folder renaming can always be done later, using the same number of keystrokes... or less if done as a batch.
It was tricky getting the exact sequence of terms that worked. I am using Dopus 9.1.1.5. Thanks to all previous posters!... and thanks to GP Software as always.
The "TO" in there can/should be removed. You can use "TO " or "HERE" to specify the destination but "TO HERE" isn't right (although it appears to be harmless).