Help with custom toolbar button rename commands

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sparks
Posts: 30
Joined: 06 Jan 2022 01:33
Location: Win10, ver 22H2, Dual 1920 x 1080 @100%

Help with custom toolbar button rename commands

Post 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!

admin
Site Admin
Posts: 64915
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Help with custom toolbar button rename commands

Post 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";

sparks
Posts: 30
Joined: 06 Jan 2022 01:33
Location: Win10, ver 22H2, Dual 1920 x 1080 @100%

Re: Help with custom toolbar button rename commands

Post by sparks »

Wow, Thanks for the fast help and tip.. This support is what really is the crown jewel of this software!
:appl:

Post Reply