Need script to set extension to lower case
-
admin
- Site Admin
- Posts: 66259
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Need script to set extension to lower case
Is that possible with RegExp, or do I have to add a new script command tolowercase or lcase?
FAQ | XY News RSS | XY X
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Re: Need script to set extension to lower case
Can't be done with regexp no, it doesn't change case.admin wrote:Is that possible with RegExp, or do I have to add a new script command tolowercase or lcase?
Now that the bug found today about Batch Rename and same case has been fixed, I think this little script should work, but obviously it only works with one item selected. (That's of course until we get a way to loop though them all
Code: Select all
set $base, <curbase>;
// lowercase
#127;
set $ext, <curext>;
rename , "$base.$ext/e";Proud XYplorer Fanatic
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Need script to set extension to lower case
Quite a few implementations do support the use of \u \U \l and \L in the replacement pattern to change case.jacky wrote:Can't be done with regexp no, it doesn't change case.admin wrote:Is that possible with RegExp, or do I have to add a new script command tolowercase or lcase?
That said, the one used by XY doesn't seem to be one of them.
-
admin
- Site Admin
- Posts: 66259
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Need script to set extension to lower case
Script works! Merci!jacky wrote:Can't be done with regexp no, it doesn't change case.admin wrote:Is that possible with RegExp, or do I have to add a new script command tolowercase or lcase?
Now that the bug found today about Batch Rename and same case has been fixed, I think this little script should work, but obviously it only works with one item selected. (That's of course until we get a way to loop though them all)
BTW tolowercase or lcase are very bad names if it only affects the extension, as they could easily be confused for #127; (File / Rename Special / aaa aa.aaa) I'd recommend to add it there, or add a parameter : f|b|e for full filename, base only, extension only (unless of course that was your plan all along, which may very well be the case. Probably so. So yeah just add your lowercase & uppercase commands already thenCode: Select all
set $base, <curbase>; // lowercase #127; set $ext, <curext>; rename , "$base.$ext/e";)
Of course, tolowercase or lcase were meant as general string functions!
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 66259
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Need script to set extension to lower case
This seems to do the same job, but shorter:jacky wrote:Code: Select all
set $base, <curbase>; // lowercase #127; set $ext, <curext>; rename , "$base.$ext/e";
Code: Select all
set $base, <curbase>;
// lowercase
#127;
rename , $base;FAQ | XY News RSS | XY X
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
XYplorer Beta Club