Rename - If file, else folder

Is there a way to run an if/else statement on a rename button so it uses 1 pattern on files and another on folders?

File Pattern:

Rename PATTERN "*.*" TO "* (Text).*"

Folder Pattern:

Rename PATTERN "*" TO "* (Text)"

The whole idea is to keep the file/folder name as-is and add (text) to the end. If there is a pattern that works on both, then I'm having troubles finding it.

Thanks!

no if else needed, just the two renames applied only to the relevant types if items:

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>Renamebutton</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>Rename PATTERN &quot;*.*&quot; TO &quot;* (Text).*&quot; TYPE=files </instruction> <instruction>Rename PATTERN &quot;*&quot; TO &quot;* (Text)&quot; TYPE=dirs</instruction> </function> </button>

Sweet! Did not know about the TYPE=

Thank you, Miran :slight_smile: