Rename button and variable

why my button don't work ?

@set Rech={dlgstring|Replace...} @set Val={dlgstring|To...} Rename PATTERN={$Rech} TO={$Val} FINDREP @NODESELECT

Just use:

rename PATTERN="{dlgstring|Find in filename:}" TO="{dlgstring|Replace with:}" FINDREP

so easy :laughing:

but if i want to replace charatere by nothing, error :unamused:

This will allow you to remove text from a filename:

 rename pattern "{dlgstring}" to \~ findrep

The first button I posted fails if you put nothing in the "to" dialog as the command parser then seems to ignore the "to" argument and renames the entire file to FINDREP - seems like a bug to me.

Going back to the original question:

[quote="AlbatorIV"]why my button don't work ?

@set Rech={dlgstring|Replace...} @set Val={dlgstring|To...} Rename PATTERN={$Rech} TO={$Val} FINDREP @NODESELECT[/quote]

It looks like the @set command needs spaces before and after the = symbol. I would also add quotes around the {$...} codes in case either string contains a space.

e.g.

@set Rech = {dlgstring|Replace...} @set Val = {dlgstring|To...} Rename PATTERN="{$Rech}" TO="{$Val}" FINDREP @NODESELECT

What Tanis suggested is still better, IMO, but I thought it might be useful to know why the original wasn't working.

many thanks nudel
but it's always not possible to replace strings by nothing in the second inputbox, it's a pity.