DOpus 12.33
I have a button "Last_Rename" defined to recall the last rename that was used:
[Standard Function]
Rename Pattern * to *
Rename PRESET=last
The script correctly opens the rename dialog and recalls the last rename that was used. However I still have to click the ENTER button in the dialog. That's not a big deal, but I want to automate the ENTER button press, execute the rename, and close the rename window. What I'm missing is the keypress step. It seems simple but I've spent two hours trying to find/script a solution.
I've tried using the most relevant example I could find from another (unrelated) forum post but I'm getting completely lost.
This is the code that doesn't work:
Rename Pattern * to *
Rename PRESET=last
@script vbscript
Option Explicit
function OnClick(clickData)
{
var wsh = new ActiveXObject("WScript.Shell");
wsh.SendKeys("{ENTER}");
}
When I use that code into my Last_Rename button, I get a script error, and I can not for life of me (out of pure ignorance, I'm sure) figure out what I'm doing wrong:
Error at line 4, position 1
{
^
Invalid character (0x800a0408)
Parse error - script aborted
Can someone who knows way more about scripting than I do tell me what I'm doing wrong?