Button to add AND delete the same string of text

got me some nonworking button code here:

I'm trying to have the user type a string they want removed from the selected file.
The string is then reapplied to the beginning of the filename.

@set var={dlgstring|Enter Series and Season}
Rename FINDREP PATTERN="($var)" TO "~" AUTORENAME
Rename PATTERN "." TO "($var)." AUTORENAME
@NODESELECT

help?

You just need {$var} instead of ($var):

@set var={dlgstring|Enter Series and Season} Rename FINDREP PATTERN="{$var}" TO "\~" AUTORENAME Rename PATTERN "*.*" TO "{$var}*.*" AUTORENAME @NODESELECT

Thank you sir.
Need glasses.