rename script - Help!

Post Reply
maurizio
Posts: 41
Joined: 04 Sep 07 16:16
Location: cagliari, sardinia, italy

rename script - Help!

Post by maurizio »

Hello,
in order to make a batch rename of a large set of images, I'm building my custom batch command.
I saw that it is possible to embed a script into the file names rules
Capture.JPG
Capture.JPG (22.84 KiB) Viewed 3186 times
This is one of the great advantages of PSU over its competitors.

So I put my own script in %code, in order to extract the last 4 digits of the numeric part of the file name.
I tried a script like this:

Code: Select all

result := RightStr(%FileNumber, 4);
but I got a number different than what I expected. Maybe %FileNumber returns a pointer which should be converted to a string ?
Can anybody help me ?

Thanks in advance

Maurizio
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: rename script - Help!

Post by Hert »

You don't need a script for that; try this instead:

Code: Select all

%FileNumber{right=4}.%FileExtension
If you want it in a script; I think this would give the same (but slower than macro only)

Code: Select all

result := RightStr('%FileNumber', 4);
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
maurizio
Posts: 41
Joined: 04 Sep 07 16:16
Location: cagliari, sardinia, italy

Re: rename script - Help!

Post by maurizio »

Very helpful, thank you!
Post Reply