Copy selected files into new folder possible?

hello
i want to ask if it is possible to select files and then pressing a hotey can be used to create a new folder (ask user for a name) and then copy the selected files into that folder.

I use the second from a previous thread
copy into new folder

@set dir={dlgstring|Enter new folder name to copy files to} CreateFolder ".\{$dir}" Copy TO ".\{$dir}"
move into new folder

@set dir={dlgstring|Enter new folder name to copy files to} CreateFolder ".\{$dir}" Copy MOVE TO ".\{$dir}"
you can assign a hotkey to a button once it has been created

I've long used:

In a hotkey, to copy selected items to a new folder in the current folder:

dopusrt /cmd copy here createfolder "{Rs|COPY to new folder...|{s}}"

Very slight change, used in the 'All files and folders' drop menu, to copy selected items to a new folder in whatever folder you drop the items onto to call up the drop menu (current, destination, an actual folder items that you drop on...):

dopusrt /cmd copy here createfolder "{Rs|COPY to new folder...|{d}}"

thanks

i use

@set dir={dlgstring|Enter new folder name to copy files to} CreateFolder ".\{$dir}" Copy MOVE TO ".\{$dir}"

it works perfectly

[quote="kakartha"]I use the second from a previous thread
copy into new folder

@set dir={dlgstring|Enter new folder name to copy files to} CreateFolder ".\{$dir}" Copy TO ".\{$dir}"
move into new folder

@set dir={dlgstring|Enter new folder name to copy files to} CreateFolder ".\{$dir}" Copy MOVE TO ".\{$dir}"
you can assign a hotkey to a button once it has been created[/quote]
it works, but only with one file. if i have multiple files selected it wants to create a folder for each file.

A second question: How could i implement a command that pastes files in clipboard into a new folder?

i just tried to make an inline rename

CreateFolder ".\New Folder" Copy MOVE TO ".\New Folder" Rename INLINE ".\New Folder"

i guess it would work but if rename waited for copy command finishing. is there a way to implement that?

You don't need to use three commands; one is all you need since the Copy command can create folders as well. Look at Steje's examples.

but can i do that with inline naming too?

Not easily, as far as I can think of.

But you're setting the name in the {dlgstring} prompt... why would you need/want to rename it AFTER copying the files into a folder whose name you just created...?

i dont want {dlgstring} prompt

If this is a redundant process there is a solution. MacroExpressPro can do it or work with Opus to accomplice the issue.

Bob

The trick with using ANY method (external macro tool, scripted stuff in Opus, etc) to handle this is going to be that you need some way of figuring out when the file copy/move is complete before renaming the new folder.

Seems unnecessarily complicated to me - just because you have some unexplained aversion to the dlgstring prompt... you're going to fiddle around to come up with a way that may 'break' depending on the situation, which I assume could result in some items you're trying to copy/move throwing an error if your method gets to change the new folder name before the copy completes...

its not that a big deal if inline does not work but it would have been nice if Dopus had this flexibility. I have to wait for an update or settle with it.

another question: this command only works when files are selected. is there a way that just creates an empty folder if no file is selected?

Here is the button I use that was posted in another post. It will take all selected files, and move them into a folder that by default, names the folder the same as the first file that is selected (minus the extension). But it gives you this suggested name in a popup window so you can make the name anything you want. Click OK and it creates the folder and moves the files.

before:


after:

Function: MS-DOS Batch Function

@nofilenamequoting @runonce:@set dirname={dlgstringS|Enter name of folder to move selection into|{file$|noext}} Copy MOVE HERE FILE="{file$}" CREATEFOLDER="{$dirname}" @nodeselect

The button does not work to just create a folder if no file is selected. Maybe someone could modify it to do that.

@set dirname={dlgstring|Enter name of folder to move selection into|{file|noext}} CREATEFOLDER NAME "{$dirname}" NOSEL Copy MOVE {file} TO="{sourcepath}{$dirname}"

@set dirname={dlgstring|Enter name of folder to move selection into|{file|noext}} CREATEFOLDER NAME "{$dirname}" NOSEL Copy MOVE {file} TO="{sourcepath}{$dirname}"[/quote]
Thanks Kundal,

But it doesn't work? It creates the folder but never moves the files into it. Is that only me?

Also, my button selects the text in the popup so there is no need to select the name if the default name isn't wanted.

I don't need this button. Just testing for the original poster.

It's working for me. Only selected files are moved to the new Folder. It only moves nothing for me if I didn't select anything.

Change dlgstring to dlgstringS in the first line.

great, thanks.

just one little thing. the normal createfolder function used to select the newly created folder.
i tried to do this with
Select "{$dirname}"
but there is nothing happening. does anybody have an idea why?

Delete NOSEL from the second line.

thanks
yet an empty folder is still not being selected