What's the easiest way to check if a tab exists...?
-
Dustydog
- Posts: 321
- Joined: 13 Jun 2016 04:19
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.)
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
Dustydog
- Posts: 321
- Joined: 13 Jun 2016 04:19
Re: What's the easiest way to check if a tab exists...?
Thank you for your time highend. That really helped.
XYplorer Beta Club