Hi @Leo indeed honestly i am not understanding that bug.
I thought the bug applied to parameters outside the {}? Not sure though.
Adding noterm| and \\ as instructed made no difference see below.
Not sure how to use @nofilenamequoting in FAYT. Is that possible?
With going back to a regex rename the old problem (probably a bug) came back: \1 needs an additional \ when it's the first component of the new file name. So your script needs to replace Str_Suffix with \ if it is empty.
@slouw I don't follow you seriously. Does your script do anything more complicated than the screenshots you show or why do you need to use regex there? Or codes like {alias} that are more intended to be used outside of scripts and also have their equivalents. A simplified way to approach your problem would be:
function OnClick(cmdData) {
DOpus.Output('START!!');
var dest = cmdData.func.dlg.GetString('Enter alias name', 'al20', 100, 'Ok|Cancel', "Alias Name");
if (!dest) return;
var suffix = cmdData.func.dlg.GetString('Enter suffix');
if (suffix === undefined) suffix = '';
try {
dest = DOpus.Aliases(dest).path;
}
catch (e) {
DOpus.Output("You're screwed!!");
return;
}
if (!DOpus.FSUtil.Exists(dest)) {
DOpus.Output("You're screwed again!!");
return;
}
var cmd = cmdData.func.command;
var cmdline = 'RENAME IGNOREEXT PATTERN=* TO="' + dest + '\\*' + suffix+'"';
DOpus.Output(cmdline);
cmd.RunCommand(cmdline);
DOpus.Output('DONE!!');
}
Testing with your examples gives me no errors. The example is simplified since you don't show the whole process you are doing or what you need it for. For your example I think COPY MOVE would also work and use AS if you need to add a suffix, but I don't see the need to use regex, at least in your example.
@errante thanks. I have wondered ineed if I have the best approach.
I will just respond to @Leo and @lxp above then i will look into your script. Much appreciated...
Haha I have a bit. I know that is the next thing to test.
This has turned into Ben Hur double haha
Public holiday in Aus today so will work on this more...