tab([operation], [data], [index], [ID])
operation:
"activate" = activate (foreground) a tab
index: index of the tab to activate (leftmost tab = 1)
Activate Tab from script
Re: Activate Tab from script
I have some weird stuff going on. Here is my script.
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.
But as soon as I lock the Tree it starts behaving weird. The selection in the Locked Tree stops following the path changing.
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);
}
But as soon as I lock the Tree it starts behaving weird. The selection in the Locked Tree stops following the path changing.
Re: Activate Tab from script
Works fine here...
Btw, a much more concise script would be:
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); }
One of my scripts helped you out? Please donate via Paypal
Re: Activate Tab from script
Your script, clean app, same weird stuff...