Inclusive New Folders Options in a Single Three Button Button

This button puts many new folder creation options in a single button.

If no folder is selected, the LMB creates a new folder in the folder display with the user entering the name. If a folder is selected, a new folder is created under the selected folder with the user entering the name.

The RMB creates a new folder from text in the clipboard.

Under the MMB for Options you can create a new folder and immediately edit the name, create a new folder that is the current date, or create a new folder for each selected file
Screen 24-12-02 09_28_06AM

Here is the button:
Create New Folders.dcf (5.2 KB)

Here is the code:

<?xml version="1.0"?>
<button 3dborders="no" backcol="none" display="label" dropdown_glyph_slim="yes" icon_size="large" label_pos="right" popout="right" textcol="#ff8000" type="three_button">
	<label>Create New Folders</label>
	<icon1>#makedir</icon1>
	<button 3dborders="no" backcol="none" display="label" dropdown_glyph_slim="yes" icon_size="large" label_pos="right" popout="right" textcol="none">
		<label>New Folder in the Source File Display or the Selected Folder</label>
		<icon1>#makedir</icon1>
		<function type="normal">
			<instruction>@ifsel:numdirs=1</instruction>
			<instruction>@nodeselect</instruction>
			<instruction>@Set FolderName {dlgstringS|Create a New Subfolder within the Selected Folder\n\nPlease enter the new subfolder name.|New Subfolder}</instruction>
			<instruction>CreateFolder &quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//Displays the parent folder with the new folder selected and unexpanded</instruction>
			<instruction>Go EXPANDBRANCH</instruction>
			<instruction>@ifsel:else</instruction>
			<instruction>@disablenosel</instruction>
			<instruction>@Set FolderName {dlgstringS|Create a New Folder in the Source File Display\n\nPlease enter the new folder name.|New Folder}</instruction>
			<instruction>CreateFolder &quot;{$FolderName}&quot;</instruction>
			<instruction>Go EXPANDBRANCH</instruction>
			<instruction>//</instruction>
			<instruction>//To edit new folder name</instruction>
			<instruction>//CreateFolder INLINE</instruction>
			<instruction>//</instruction>
			<instruction>//Display Options</instruction>
			<instruction>//Displays contents of new folder</instruction>
			<instruction>//CreateFolder &quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//Go &quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//</instruction>
			<instruction>//Displays {sourcepath} with parent of new folder selected</instruction>
			<instruction>//CreateFolder &quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//CreateFolder NAME=&quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//</instruction>
			<instruction>//Displays new folder selected</instruction>
			<instruction>//CreateFolder &quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//Go &quot;{filepath}{$FolderName}&quot;</instruction>
			<instruction>//Go &quot;..&quot;</instruction>
			<instruction>//</instruction>
			<instruction>//Alternate Code - Slow</instruction>
			<instruction>//Old Method takes longer to display {sourcepath} with parent of new folder selected</instruction>
			<instruction>//FileType NEW=directory PATH={filepath} NEWNAME=&quot;{dlgstring|New Folder Name\n\nPlease enter the new subfolder name.|New Folder}&quot;</instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
		<label>Clipboard</label>
		<tip>In the File Display from the Clipboard</tip>
		<icon1>#makedir</icon1>
		<function type="normal">
			<instruction>//CreateFolder FROMCLIPBOARD</instruction>
			<instruction>//CreateFolder &quot;{clip}&quot;</instruction>
			<instruction>CreateFolder FROMCLIPBOARD=multi </instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none" type="menu">
		<label>Options</label>
		<icon1>#makedir</icon1>
		<button backcol="none" display="label" field_type="label" size="full" textcol="none">
			<label>&lt;b&gt;Create a New Folder&lt;/b&gt;</label>
			<icon1>#label</icon1>
			<function type="normal">
				<instruction>Set LABEL</instruction>
			</function>
		</button>
		<button 3dborders="no" backcol="none" display="label" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
			<label>Edit the Name</label>
			<icon1>#makedir</icon1>
			<function type="normal">
				<instruction>@Set FolderName {dlgstringS|New Folder Name\n\nPlease enter the new folder name.|New Folder}</instruction>
				<instruction>CreateFolder &quot;{$FolderName}&quot;</instruction>
				<instruction>CreateFolder INLINE</instruction>
			</function>
		</button>
		<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
			<label>The Name Is the Current Date</label>
			<icon1>#makedir</icon1>
			<function type="normal">
				<instruction>CreateFolder NAME=&quot;{date|yyyy-MM-dd}&quot;</instruction>
			</function>
		</button>
		<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
			<label>For Each Selected File</label>
			<icon1>#makedir</icon1>
			<function type="normal">
				<instruction>//@nodeselect</instruction>
				<instruction>//Clipboard COPYNAMES=nopaths REGEXP ^(.*)\.[^.]*$ \1</instruction>
				<instruction>//CreateFolder FROMCLIPBOARD</instruction>
				<instruction>//</instruction>
				<instruction>//Copy HERE CREATEFOLDER= {file$|noext} MOVE</instruction>
				<instruction>//</instruction>
				<instruction>@disablenosel:files</instruction>
				<instruction>CreateFolder NAME=&quot;{file|noext}&quot;</instruction>
			</function>
		</button>
	</button>
</button>

Please include a description of what this does and why someone would want to use it instead of the default buttons.

2 Likes