Command: Create new folder in parent folder (and move files)

Hi,

I'm a relatively new user of Directory Opus and have a problem putting my first script together.

And sorry if this was answered somewhere else already, there are many very similar questions here already. But all solutions differ in detail and I'm actually getting more confused the more threads I find (often the commands and arguments are even written differently in those).

What I would like to do is this:

  • Select files in a folder
  • Move these files to a new folder, one hierarchy level up, being asked for a folder name (prefilled with the name of the folder they are currently in)

This is what I have so far:

Copy MOVE TO {filepath$|..\..} CreateFolder {filepath$|nopath|noterm} ASK

But neither the "get current folder name" nor that "ASK" thing works. And even if I just use "CreateFolder ASK" for testing reasons, I'm not prompted to enter a folder name (it just creates a folder name ASK). What am I doing wrong?

Thanks for your help in advance.

Try

@nofilenamequoting
@set nf="{sourcepath|..}{dlgstring|Enter Foldername|{sourcepath|nopath|noterm}}"
Copy MOVE HERE CREATEFOLDER={$nf}
1 Like

I would use this, if you want the new folder named after the first selected file/folder (by default), and with the file extension taken off the end:

@set NewDir={dlgstring|Parent folder name:|{file$|noext|noterm}}
Copy MOVE TO={filepath$|..\..} CreateFolder="{$NewDir}"

If you need it to work on Flat View (but not Find Results) when the selected items are not all in the same folder, and you want all the items put in the same folder (not in a folder created above where each file is):

@set NewDir={dlgstring|Parent folder name:|{file$|noext|noterm}}
Copy MOVE TO={sourcepath$|..} CreateFolder="{$NewDir}"
1 Like