// This is similar to "Preferences / Display / Options / \Lister title bar: Display layout name". // But it sets the title in a way that it will be saved if you exit and restart Opus. function OnInit(initData) { initData.name = "LayoutTitles"; initData.version = "1.0"; initData.copyright = "(c) 2021 Leo Davidson"; initData.url = "https://resource.dopus.com/t/finding-the-right-tab/37515/13"; initData.desc = "Add layout name to titlebar"; initData.default_enable = true; initData.min_version = "12.0"; } function OnOpenLister(openListerData) { var layoutName = openListerData.lister.layout; // "openlisters" is the special layout used to save windows when Opus is exited and restarted. // We want to ignore that layout, so that any titles saved into its listers are left as-is. if (layoutName == "" || layoutName == "openlisters") return; // For all other layouts, set the window title to include their names. var cmd = DOpus.Create.Command(); cmd.SetSourceTab(openListerData.lister.activetab); // %N means the name of the current folder. // See https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Set.htm for other codes you can use. cmd.RunCommand('Set LISTERTITLE="notoggle:' + layoutName + ': %N - Directory Opus'); }