// Called by Directory Opus to initialize the script function OnInit(initData) { initData.name = "Layout taskbar groups"; initData.version = "1.0"; initData.copyright = "(c) 2019 Leo Davidson"; initData.url = "https://resource.dopus.com/t/move-viewers-or-layouts-into-separate-taskbar-groups/31538"; initData.desc = "Move listers opened via layouts into their own taskbar groups"; initData.default_enable = true; initData.min_version = "12.12.1"; } // Called when a new Lister is opened function OnOpenLister(openListerData) { var lister = openListerData.lister; var layout = lister.layout; // We ignore the "openlisters" layout as those are just windows // re-opened after exiting and re-launching Opus (if configured that way), // and it doesn't make sense to treat them specially. if (layout != null && layout != "" && layout != "openlisters") { // The group name is truncated if longer than 103 characters // so this will group multiple layouts together if people have // ridiculously long layout names that are similar for the first // 103 characters. If that matters to you, you could hash the name // or something. lister.SetTaskbarGroup(layout); } }