// Called by Directory Opus to initialize the script function OnInit(initData) { initData.name = "Name Substrings"; initData.version = "1.0"; initData.copyright = "(c) 2017 Leo Davidson"; initData.url = "https://resource.dopus.com/t/sorting-a-portion-of-the-filename/25966"; initData.desc = "Adds a column with substrings of each file's name, for custom sorting."; initData.default_enable = true; initData.min_version = "12.0"; var col = initData.AddColumn(); col.name = "NameSubstring"; col.method = "OnNameSubstring"; col.label = "Substring"; col.type = "String"; col.justify = "left"; col.autogroup = true; col.namerefresh = true; } // Implement the OnNameSubstring column function OnNameSubstring(scriptColData) { scriptColData.value = scriptColData.item.name.substring(11); }