Page 1 of 1
Create New Directory and Move Files Script
Posted: 02 Mar 2008 00:54
by iryx
I have a directory with a big amount of files. I would like to use the scripting feature to: 1. create a new directory and 2. move the selected files in the new directory.
I'm sure there is an easy way but I can't seem to get it yet. Any thoughts?
Re: Create New Directory and Move Files Script
Posted: 02 Mar 2008 01:00
by jacky
iryx wrote:I have a directory with a big amount of files. I would like to use the scripting feature to: 1. create a new directory and 2. move the selected files in the new directory.
I'm sure there is an easy way but I can't seem to get it yet. Any thoughts?
Not sure what exactly you want to do, but to move selected items anywhere you can simply use command moveto
And if the destination folder doesn't exists, XY will create it on-the-fly ! That's a standard feature of XY's Move/Copy/Backup To feature, i.e. works the same using the GUI
Sorry, I wasn't clear
Posted: 02 Mar 2008 01:06
by iryx
I want a new folder to be created every time I invoke the command. That could be either based on the first file in the selection or based on the date and time.
Re: Sorry, I wasn't clear
Posted: 02 Mar 2008 02:34
by jacky
iryx wrote:I want a new folder to be created every time I invoke the command. That could be either based on the first file in the selection or based on the date and time.
moveto "<curbase>";
or
moveto "<dyyyy-mm-dd hh-nn>";
Syntax here
Re: Sorry, I wasn't clear
Posted: 02 Mar 2008 10:00
by admin
iryx wrote:I want a new folder to be created every time I invoke the command. That could be either based on the first file in the selection or based on the date and time.
This should do (selects all items in current folder, then moves them to newly created (if nececssary) subfolder named acc. to current date/time:
sel a; moveto "<dyyyy-mm-dd hh-nn>";
Try with care on some test files...
Current Solution
Posted: 02 Mar 2008 15:45
by iryx
Close,
here is what I ended up doing:
input $ext, Enter Name, _<dyyyy.mm.dd>-<curbase>;moveto $ext
since I only wanted to move the selected items to a new subdirectory based on the name of the selected items and not all files.