I'm using following command set:
@confirm:Do you really want to secure wipe the file?|Yes|NO
Delete SECURE
I'd like the prompt dialog to default button to "NO" in this case, since my Windows settings is set to always jump to default prompt button.
Is this currently possible?
It's currently like this:
abr
2
Looks like it's not possible, as there is only one template for @confirm, that isn't changeable at the moment.
lxp
3
Doable with a script button:
// https://resource.dopus.com/t/default-button-in-confirm/55328
function OnClick(clickData) {
var cmd = clickData.func.command;
var dlg = clickData.func.Dlg();
cmd.deselect = false;
dlg.title = 'DeleteSecure';
dlg.message = 'Do you really want to secure wipe the file?';
dlg.buttons = 'Yes|NO';
dlg.defid = 0;
if (dlg.Show()) cmd.RunCommand('Delete SECURE');
}
XML
<?xml version="1.0"?>
<button backcol="none" display="label" hotkey_label="yes" label_pos="right" textcol="none">
<label>55328</label>
<tip>default-button-in-confirm</tip>
<icon1>#script</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>// https://resource.dopus.com/t/default-button-in-confirm/55328</instruction>
<instruction />
<instruction>function OnClick(clickData) {</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> var dlg = clickData.func.Dlg();</instruction>
<instruction />
<instruction> cmd.deselect = false;</instruction>
<instruction />
<instruction> dlg.title = 'DeleteSecure';</instruction>
<instruction> dlg.message = 'Do you really want to secure wipe the file?';</instruction>
<instruction> dlg.buttons = 'Yes|NO';</instruction>
<instruction> dlg.defid = 0;</instruction>
<instruction />
<instruction> if (dlg.Show()) cmd.RunCommand('Delete SECURE');</instruction>
<instruction>}</instruction>
</function>
</button>
4 Likes
Thnx. I just modified it a bit to display a warning image along with the prompt.
// https://resource.dopus.com/t/default-button-in-confirm/55328
function OnClick(clickData) {
var cmd = clickData.func.command;
var dlg = clickData.func.Dlg();
cmd.deselect = false;
dlg.title = 'Secure Delete';
dlg.message = 'Do you really want to secure wipe the file/folder?';
dlg.buttons = 'Yes|No';
dlg.icon = 'warning'
dlg.defid = 0;
if (dlg.Show()) cmd.RunCommand('Delete SECURE');
}
lxp
5
Let's not forget about sound 
cmd.RunCommand('Play FILE="/windows\\Media\\Windows Notify" QUIET');