Code: Select all
regexreplace $name, <curitem>, "^.+\\([^\\]+?)\\[^\\]+?.*$", "$1";
rename bat, $name;Code: Select all
rename bat, "$name.ext/e";Code: Select all
regexreplace $name, <curitem>, "^.+\\([^\\]+?)\\[^\\]+?.*$", "$1";
rename bat, $name;Code: Select all
rename bat, "$name.ext/e";Same but shorter, and also works in drives roots (sets name to [drive letter].ext):jacky wrote:Code: Select all
regexreplace $name, <curitem>, "^.+\\([^\\]+?)\\[^\\]+?.*$", "$1"; rename bat, $name;
Code: Select all
set $name, <curfolder>;
rename , $name;Code: Select all
rename , <curfolder>Ahhhhhh.jacky wrote:PS: btw you can make it even shorter, of course:![]()
Code: Select all
rename , <curfolder>
It must be noted that this script doesn't result in the same renaming result as the one posted in the first post if there are files that have the same name but different extension in the same folder.jacky wrote:PS: btw you can make it even shorter, of course:![]()
Code: Select all
rename , <curfolder>
Good point. You will get that with the next beta release.ivan wrote:And what if I wanted that "suffix" to be just before a certain symbol at the end of a filename (the symbol is a dash if it helps)?
EDIT: I guess what I'm asking is: is it possible for a script to override a preference?
The logic behind it is that a person may not be aware of a preference or needs it tweaking a little.
Code: Select all
E.g., to name items as their containing folder while having full
control over the number suffix format and start number, you now
can use any of these scripts without fearing collisions:
::rename , <curfolder>-<#001>, p;
::rename , <curfolder>-<#00001>, p;
::rename , <curfolder>-<#23>, p;But is it still possible to disable scripts overriding through a preference? Methinks it's not so can we please have some balance so if a script can override a preference then a preference should be able to overpower whether a script is able to stomp all over a preference. I hope I'm making some senseadmin wrote:Good point. You will get that with the next beta release.

No. Try again, please.ivan wrote:But is it still possible to disable scripts overriding through a preference? Methinks it's not so can we please have some balance so if a script can override a preference then a preference should be able to overpower whether a script is able to stomp all over a preference. I hope I'm making some senseadmin wrote:Good point. You will get that with the next beta release.
admin wrote:No. Try again, please.ivan wrote:But is it still possible to disable scripts overriding through a preference? Methinks it's not so can we please have some balance so if a script can override a preference then a preference should be able to overpower whether a script is able to stomp all over a preference. I hope I'm making some senseadmin wrote:Good point. You will get that with the next beta release.