Need script to set extension to lower case
Posted: 08 Apr 2008 21:51
Is that possible with RegExp, or do I have to add a new script command tolowercase or lcase?
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
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?
Code: Select all
set $base, <curbase>;
// lowercase
#127;
set $ext, <curext>;
rename , "$base.$ext/e";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?
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";)
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;