Page 1 of 1

Help with custom toolbar button rename commands

Posted: 01 Jan 2025 07:13
by sparks
I often need to append some text in front of, and behind filenames.
I found two script lines to do that, and hooked the two commands to the Rht & Lft clicks of a custom toolbar button.

The prob of using script stuff, but barely knowing anything, leads to odd problems, and mistakes hard to troubleshoot.
But customizing XY is so easy and productive, and the forum help is so quick and great, I don't have to be an expert to benefit.

>>Here's my two separate command lines.. 1st one works fine, 2nd one the filename disappears..

$string = input("Enter the text to prefix:"); rename "b", "$string*", "p";

$string = input("Enter the text to append:"); rename "b", "*$string", "p";

Once I know what's wrong, I'll remove the "p" for 'preview' to speed things up. This will be one more great timesaver for me. Thanks!

Re: Help with custom toolbar button rename commands

Posted: 01 Jan 2025 11:03
by admin
The sequence *$ is reserved for dereferencing. Try this way instead:

Code: Select all

$string = input("Enter the text to append:"); rename "b", "*" . $string, "p";

Re: Help with custom toolbar button rename commands

Posted: 01 Jan 2025 21:26
by sparks
Wow, Thanks for the fast help and tip.. This support is what really is the crown jewel of this software!
:appl: