06-24-2025, 08:33 PM
// script "Totalcmd tray icon.cs"
/// On Keypress Ctrl+Alt+s adds tray icon and stays running. If Total Commander if not running runs and exits.
/*/ ifRunning run; /*/
var w = wnd.find(@"*Notepad++", "Notepad++", flags: WFlags.HiddenToo);
if (w.Is0) {
run.it(@"C:\Program Files\Notepad++\notepad++.exe");
} else if (w.IsVisible) {
script.trayIcon(0,
init: t => {
t.Icon = icon.ofWindow(w);
t.Tooltip = "Show Total Commander";
t.Click += e => { timer.after(30, _ => w.Activate()); };
}
);
w.Show(false);
try { w.WaitFor(0, w => w.IsVisible); } catch { }
} else {
w.Activate();
}To assign a trigger use menu TT > New trigger.
