Page 1 of 1
Activate Tab from script
Posted: 19 Nov 2021 08:08
by Evolve
tab([operation], [data], [index], [ID])
operation:
"activate" = activate (foreground) a tab
index: index of the tab to activate (leftmost tab = 1)
Re: Activate Tab from script
Posted: 19 Nov 2021 08:29
by highend
seltab ...
Re: Activate Tab from script
Posted: 19 Nov 2021 08:33
by Evolve
Thanks...

Re: Activate Tab from script
Posted: 19 Nov 2021 08:34
by highend
Moved...
Re: Activate Tab from script
Posted: 19 Nov 2021 18:53
by Evolve
I have some weird stuff going on. Here is my script.
Code: Select all
$path = itematpos();
$number_of_tabs = tab("get", "index", -1);
$index = 0;
while ($number_of_tabs > 0){
if($path == tab("get", "path", $number_of_tabs)){
$index = tab("get", "index", $number_of_tabs);
break;
}
$number_of_tabs--;
}
if($index != 0){
seltab $index;
}else{
tab("new", $path);
}
I use it for CEA
Middle-click on folder. It basically either opens a path in a new tab if no existing tab matches the path or reusing existing tab if there is one which does match. It works fine in List and Unlocked Tree.
PllsMM348I.gif
But as soon as I lock the Tree it starts behaving weird. The selection in the Locked Tree stops following the path changing.
Y1FhiWC54s.gif
Re: Activate Tab from script
Posted: 20 Nov 2021 00:28
by highend
Works fine here...
Btw, a much more concise script would be:
Code: Select all
$path = itematpos();
$tabs = get("Tabs", <crlf>);
$matches = regexmatches($tabs, "^" . regexreplace($path, "([\\.+(){\[^$])", "\$1") . "$", <crlf>);
if ($matches) { seltab gettokenindex(gettoken($matches, 1, <crlf>), $tabs, <crlf>, ""); }
else { tab("new", $path); }
Re: Activate Tab from script
Posted: 20 Nov 2021 10:40
by Evolve
Your script, clean app, same weird stuff...
PDB19bzj1D.gif