More than two rename commands in a button?

PHPBB_IMPORT_WARNING CODE_NEAR_LI

Hi, I'm new here and happy to be a part of the community :slight_smile:

I am having severe problems with creating a button to rename things (DOpus 9.5).
I'm starting to rip my hair out over this,because I do not know how to tell DOpus to handle more than 2 rename instructions in a button.

Take this e.g.:

@NoDeselect @confirm Rename REGEXP PATTERN="(.*[0-9]+)\.([.0-9]+.*)#" TO="\1()()\2" @confirm Rename REGEXP PATTERN="(.*)[\.|_](.*)#" TO="\1 \2" @confirm Rename REGEXP PATTERN="(.*)\(\)\(\)(.*)#" TO="\1.\2"

What i see it does:

[ol]Testfolder 2.3.f
[li]First rename instruction works (2.3.f -> 2()()3.f)[/li]
[li]Second rename instruction works (2()()3.f -> 2()()3 f)[/li]
[li]Third rename instruction generates error saying it cannot rename 2()()3.f because it does not exist and terminates[/li][/ol]

Weird things I have concluded:

The problem here is that the third instruction does not know that the second instruction has run and so it somehow still sees the folder name that the first instruction has created (which of course does not exist anymore in the real filesystem because the second instruction has modified it). So the third instruction finds a match for the folder name it sees, but when trying to rename, it generates an error, because it cannot access it in the real filesystem.

Seems logical, except for: Why does the third instruction NOT see that the second instruction has run? How do I make the whole thing work?

Example 2:

@NoDeselect @confirm Rename REGEXP PATTERN="(.*)\.(.*)#" TO="\1-\2" @confirm Rename REGEXP PATTERN="(.*)-(.*)#" TO="\1.\2" @confirm Rename REGEXP PATTERN="(.*)\.(.*)#" TO="\1-\2"

It does:

[ol]Testfolder 2.3
[li]First rename instruction works (2.3 -> 2-3)[/li]
[li]Second rename instruction works (2-3 -> 2.3)[/li]
[li]Third rename does nothing because, again, the third instruction sees only the folder name 2-3 from the first instruction and so it does nothing. (no error message since it does not attempt renaming, since the name it sees does not match)[/li][/ol]

Please help, it would be really helpful, I probably shoud not have wasted about 5 hours trying to figure it out myself (but i did and was unsuccessful as you can see)

Thanks

See here for a better way: Script to perform multiple Regular Expressions