Hi,
Incompatibility with Select and rename command ?
I created a button that changes extension of selected files. This command does the job:
Rename TYPE=files REGEXP PATTERN="^(.*)(\.[^.]+)$" TO="\1{dlgstring|Enter wanted extension|.}" autorename
but if I add (cause I consider it's a better way):
select NONE
select SIMPLE
Rename TYPE=files REGEXP PATTERN="^(.*)(\.[^.]+)$" TO="\1{dlgstring|Enter wanted extension|.}" autorename
It simply fails. DOpus jumps to "rename" command and forget "select" command.
Yet if "select" command are used alone,
select NONE
select SIMPLE
it works.
Do I do something wrong ?
Spaces in variable
I created a button that add trailing number to files or folders so that for example: "test.mp3" files or "test" folders results "test - 01.mp3" and "test - 01" and so on.
I had to use variables so that it works for files as well as folders. Plus variables allows to choose options order:
@nodeselect
@runonce:@set num={dlgstring|Enter leading number|01}
@runonce:@set sep={dlgstringS|Enter a separator, a space or nothing|" - "}
Rename TYPE=files NUMBER {$num} REGEXP PATTERN="(.*)(\.[^.]+)$" TO="\1{$sep}[#]\2" autorename
Rename TYPE=dirs NUMBER {$num} REGEXP PATTERN="(.*)" TO="\1{$sep}[#]" autorename
But spaces filled in alone or around a separator such as [ - ] aren't taken into account in the new name, I get "test-01.mp3" instead of "test - 01.mp3". Tough, {$sep} = [ - ] and no [-].
So I have to change ...
TO="\1{$sep}[#]\2"
...
with
...
TO="\1 {$sep} [#]\2"
...
It's not logical because this code works:
@nodeselect
Rename TYPE=files NUMBER {dlgstring|Enter leading number||01} REGEXP PATTERN="(.*)(\.[^.]+)$" TO="\1{dlgstringS|Enter a separator, a space or nothing|"-"}[#]\2" autorename
Conclusion of my various tests: variables don't take in account leading and trailing spaces.
Do I do something wrong here too ?
Ban folder or files to execute commands
I made a button that rename 2 or more files, if their extensions are different, with the same name. It's useful for rename a movie and its subtitle :
@nodeselect
@filesonly
Rename PRESET="Nettoyage"
Rename TYPE=files REGEXP PATTERN="^(.*)(\.[^.]+)$" TO="{dlgstrings|Entrer un nom}\2" autorename
It works great on files but although it doesn't rename selected folders it opens dialog box for them anyway as if it were ready to do the job.
Is there a way to prevent this behaviour on folder, none dialbox opens ? Or is there a way to customize an error dialbox that warns that folders are not allowed ?
Please, help me to solve these 3 points