View Single Post
  #1750  
Old 21.06.2021, 07:03
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,553
Default

Quote:
Originally Posted by BJN01 View Post
But could there be some simple lines to add at the end of the script to "double" the effect?
I couldn't quite understand at first what you meant by skipped. You can use this script to replace all occurrences of a string in the file/package names, with a single click.

Code:
/*
    Cleanup names
    Trigger : Toolbar button pressed
*/

if (name == "Cleanup packagenames") {
    getAllCrawledPackages().forEach(function(i) {
        var replace = function(a, b) {
            i.name = i.name.split(a).join(b);
        }

        replace("-Vol ", "-V0");
    })
}

if (name == "Cleanup filenames") {
    getAllCrawledLinks().forEach(function(i) {
        var replace = function(a, b) {
            i.name = i.name.split(a).join(b);
        }

        replace("Ch_", "Ch");
    })
}
Reply With Quote