Try
// https://resource.dopus.com/t/create-new-folder-in-do13/48420/22
// 2024-05-03
function OnClick(clickData) {
var cmd = clickData.func.command;
var tab = clickData.func.sourcetab;
cmd.deselect = false;
if (tab.selected_dirs.count > 0) {
cmd.SetSource(tab.selected_dirs(0));
}
cmd.RunCommand('CreateFolder');
}
XML
<?xml version="1.0"?>
<button backcol="none" display="both" hotkey="ctrl+N" textcol="none">
<label>New Folder 48420</label>
<icon1>#makedir</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>// https://resource.dopus.com/t/create-new-folder-in-do13/48420/22</instruction>
<instruction>// 2024-05-03</instruction>
<instruction />
<instruction>function OnClick(clickData) {</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> var tab = clickData.func.sourcetab;</instruction>
<instruction> cmd.deselect = false;</instruction>
<instruction />
<instruction> if (tab.selected_dirs.count > 0) {</instruction>
<instruction> cmd.SetSource(tab.selected_dirs(0));</instruction>
<instruction> }</instruction>
<instruction> </instruction>
<instruction> cmd.RunCommand('CreateFolder');</instruction>
<instruction>}</instruction>
</function>
</button>