Rename selected file, preserve activate inline rename at specific position

This seems to work.

// https://resource.dopus.com/t/rename-selected-file-preserve-activate-inline-rename-at-specific-position/41349

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var wsh = new ActiveXObject('WScript.Shell');
    cmd.deselect = false;

    cmd.RunCommand('Rename CASE=lower');
    cmd.RunCommand('Rename PRESET="Invoices and Payments Files"');
    cmd.RunCommand('Rename INLINE=home');

    // In case there are timing problems
    // DOpus.Delay(1000);

    for (var i = 0; i < 26; ++i) {
        wsh.SendKeys('{RIGHT}');
    }
}
Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>41349</label>
	<icon1>#newcommand</icon1>
	<function type="script">
		<instruction>@script JScript</instruction>
		<instruction>// https://resource.dopus.com/t/rename-selected-file-preserve-activate-inline-rename-at-specific-position/41349</instruction>
		<instruction />
		<instruction>function OnClick(clickData) {</instruction>
		<instruction>    var cmd = clickData.func.command;</instruction>
		<instruction>    var wsh = new ActiveXObject(&apos;WScript.Shell&apos;);</instruction>
		<instruction>    cmd.deselect = false;</instruction>
		<instruction />
		<instruction>    cmd.RunCommand(&apos;Rename CASE=lower&apos;);</instruction>
		<instruction>    cmd.RunCommand(&apos;Rename PRESET=&quot;Invoices and Payments Files&quot;&apos;);</instruction>
		<instruction>    cmd.RunCommand(&apos;Rename INLINE=home&apos;);</instruction>
		<instruction />
		<instruction>    // In case there are timing problems</instruction>
		<instruction>    // DOpus.Delay(1000);</instruction>
		<instruction />
		<instruction>    for (var i = 0; i &lt; 26; ++i) {</instruction>
		<instruction>        wsh.SendKeys(&apos;{RIGHT}&apos;);</instruction>
		<instruction>    }</instruction>
		<instruction>}</instruction>
	</function>
</button>