What's the easiest way to check if a tab exists...?
What's the easiest way to check if a tab exists...?
What's the easiest way to check if a tab (in the unfocused pane) already exists, and to use that tab if it does? Else open a new tab to that path? (That last I believe I have down just fine, but I'd like to see how someone else does it; I suspect there may be an easier way.)
Re: What's the easiest way to check if a tab exists...?
Code: Select all
$path = "<path of a tab>";
$index = gettokenindex($path, get("Tabs", , "i"), , "i");
focus "PI";
if ($index) { seltab $index; } else { tab("new", $path); }
One of my scripts helped you out? Please donate via Paypal
Re: What's the easiest way to check if a tab exists...?
Thank you for your time highend. That really helped.