Prompt for name and move into Dated Folder Button

Has anyone written the xml code (button) that can move a number of selected files into a dated folder. The script would first prompt the user for a folder name and then adds the date as a prefix to the new folder name for example 2015-11-14_Revised Arch Plans. Where the date is system created and the name "Revised Arch Plans" is input by the user i.e. a dialog user prompt so that the user can input a bespoke name. So I suppose there are four steps the script would have to do: Step 1: create folder, Step 2: auto name folder, Step 3: prompt for user input and Step 4: then move files into new folder.

Thanking you in advance.

Try this:

Copy MOVE CreateFolder "{date|yyyy-MM-dd}_{dlgstring|Enter foldername:}" HERE

Hi Kundal;

Thank you so much this will save me a lot of time over a year of having to manually create and name folders. One click and all is done - well except for having to type the folders name. By the way I do have a standard convention i.e. standard folder names that I use when naming my folders. So I was wondering is it possible to have a drop down list of names (no repetitive tying would be necessary then) that can be selected from a list and an edit item added at the end of the list so that extra folder names could be added as the need arises? If so, this would then make this rename tool perfect for my need.

You can do something like this:

Copy MOVE CreateFolder "{date|yyyy-MM-dd}_{dlgchooseS|Folder:|Revised Arch Plans+folder 2+folder 3}" HERE

Remove the S from dlgchooseS if you don't want the list automatically sorted.

You can't have both in one but you can use a three-button with left click "Choose name" and right click "Edit name" like this:<?xml version="1.0"?> <button backcol="none" display="both" textcol="none" type="three_button"> <label>Move to dated Folder</label> <icon1>#default:move</icon1> <button backcol="none" display="both" textcol="none"> <label>Choose name</label> <icon1>#default:move</icon1> <function type="normal"> <instruction>Copy MOVE CreateFolder &quot;{date|yyyy-MM-dd}_{dlgchoose|Choose foldername:|name1=name1+name2=name2+name3=name3}&quot; HERE</instruction> </function> </button> <button backcol="none" display="both" textcol="none"> <label>Edit name</label> <icon1>#default:move</icon1> <function type="normal"> <instruction>Copy MOVE CreateFolder &quot;{date|yyyy-MM-dd}_{dlgstring|Enter foldername:}&quot; HERE</instruction> </function> </button> </button> Read the online help to get more information about Codes to display dialogs.

Hi Kundal;

Thank you again. I asked this in a somewhat "tongue in cheek" manner as I didn't expect Opus would be able to do this with its standard scripting commands. I keep being surprised just how powerful this program is and how knowledgeable are its users. It seems to me that one could almost write a completely new application just using the Opus scripting language. I am certainly looking forward to seeing what additional power the guys will deliver in Version 12 of Directory Opus. It just keeps getting more and more powerful with each version.

Kind regards, Mark

These are just simple commands, not scripting. Scripting adding in Opus 11 is even more powerful. :slight_smile: (But also more complicated, of course, so if you already have what you want then there's no reason to switch to using more powerful scripts.)