Good evening
Is it possible to close any multiple tabs with a single command or click?
For example in Firefox, I can select tabs (with + CRTL click) and then with a single click, close them all at once.
Maybe it already exists - I searched, but couldn't find anything like it.
I think that would be handy
Thank you
close multi tabs
Re: close multi tabs
No there isn't but XY has scripting support?
Code: Select all
$cntTabs = gettoken(get("tabs"), "count", "|");
$paths = "";
while ($i++ < $cntTabs) {
$name = tab("get", "name", $i);
if ($name == "") { $name = tab("get", "caption", $i); }
$paths .= $name . "|" . $i . "|" . "*" . <crlf>;
}
$ids = inputselect("Check tab(s) to close...", $paths, <crlf>, 1+2+32+128+1024+8192+16384, , 500, 600);
$cntClosed = 1;
$firstClosed = false;
foreach($id, $ids, <crlf>, "e") {
if ($firstClosed) {
$id -= $cntClosed;
$cntClosed++;
}
tab("close", 0, $id);
$firstClosed = true;
}
One of my scripts helped you out? Please donate via Paypal
Re: close multi tabs
ok thank you. Its Nice and it does what I want. But it don't give me the name of the pane
- Attachments
-
- Presse-papiers-20231212.png (13.14 KiB) Viewed 429 times
Re: close multi tabs
Get the code again, I've changed it slightly
One of my scripts helped you out? Please donate via Paypal
Re: close multi tabs
Hi,
Thank you very much it works perfectly now
It's fine and very useful.
Thank you very much it works perfectly now
It's fine and very useful.
Re: close multi tabs
Bonjour,
I used parts of 2 scripts kindly given by Highend (thanks to him).
This allows me to close the tabs in one panel then in the other.
I get this:
Then :
1 - Is it possible to change the “?” icon. » for p1 and p2 and also for virtual folders.
2 – I have to empty the variables so that the script runs correctly a second time. Is there a command to reset all variables?
Thank you for your help
I used parts of 2 scripts kindly given by Highend (thanks to him).
This allows me to close the tabs in one panel then in the other.
I get this:
Then :
1 - Is it possible to change the “?” icon. » for p1 and p2 and also for virtual folders.
2 – I have to empty the variables so that the script runs correctly a second time. Is there a command to reset all variables?
Thank you for your help
Re: close multi tabs
Check the
Empty variables to let it run a second time? Em, what?
Be more specific, show the relevant code where something doesn't work as expected and generally, post code in text form, not as an image^^
inputselect()
options to show generic icons. Maybe that fixes that.Empty variables to let it run a second time? Em, what?
Be more specific, show the relevant code where something doesn't work as expected and generally, post code in text form, not as an image^^
One of my scripts helped you out? Please donate via Paypal
Re: close multi tabs
It took me a long time to understand how to use inputselect() with style 1024 but I succeeded for the first part p1 and p2.
On the other hand, I don't see how to do it with the second part.
For variables, in fact it's only $i of the loop :
while ($i++ < $cntTabs) {
$name = tab("get", "name", $i);
if ($name == "") { $name = tab("get","caption" , $i); }
$paths .= $name . "|" . $i. "|" . "*". <crlf>;
}
which does not reset. i.e. if I have 4 tabs in the first panel, the count starts again at 5 for the second iteration of the loop. So I display 5 fewer panels.
But maybe this is normal.
The script :
While($n<2) { $n++;
$dstpanes = <<<>>>
p1|p1|C:\Users\Utilisateur\AppData\Roaming\XYplorer\Icons\cd.ico
p2|p2|C:\Users\Utilisateur\AppData\Roaming\XYplorer\Icons\cd.ico
>>>;
$dstpanes = inputselect("Select pane(s)", $dstpanes, <crlf>, 1+2+32+16384, , 600, 500);
focus "$dstpanes";
$cntTabs = gettoken(get("tabs"), "count", "|");
$paths = "";
while ($i++ < $cntTabs) {
$name = tab("get", "name", $i);
if ($name == "") { $name = tab("get","caption" , $i); }
$paths .= $name . "|" . $i . "|" . "*" . <crlf>;
}
$ids = inputselect("Check tab(s) to close...", $paths, <crlf>, 1+2+32+128+1024+8192+16384, , 500, 600);
$cntClosed = 1;
$firstClosed = false;
foreach($id, $ids, <crlf>, "e") {
if ($firstClosed) {
$id -= $cntClosed;
$cntClosed++;
}
tab("close", 0, $id);
$firstClosed = true;
}
$i=""; } ;
On the other hand, I don't see how to do it with the second part.
For variables, in fact it's only $i of the loop :
while ($i++ < $cntTabs) {
$name = tab("get", "name", $i);
if ($name == "") { $name = tab("get","caption" , $i); }
$paths .= $name . "|" . $i. "|" . "*". <crlf>;
}
which does not reset. i.e. if I have 4 tabs in the first panel, the count starts again at 5 for the second iteration of the loop. So I display 5 fewer panels.
But maybe this is normal.
The script :
While($n<2) { $n++;
$dstpanes = <<<>>>
p1|p1|C:\Users\Utilisateur\AppData\Roaming\XYplorer\Icons\cd.ico
p2|p2|C:\Users\Utilisateur\AppData\Roaming\XYplorer\Icons\cd.ico
>>>;
$dstpanes = inputselect("Select pane(s)", $dstpanes, <crlf>, 1+2+32+16384, , 600, 500);
focus "$dstpanes";
$cntTabs = gettoken(get("tabs"), "count", "|");
$paths = "";
while ($i++ < $cntTabs) {
$name = tab("get", "name", $i);
if ($name == "") { $name = tab("get","caption" , $i); }
$paths .= $name . "|" . $i . "|" . "*" . <crlf>;
}
$ids = inputselect("Check tab(s) to close...", $paths, <crlf>, 1+2+32+128+1024+8192+16384, , 500, 600);
$cntClosed = 1;
$firstClosed = false;
foreach($id, $ids, <crlf>, "e") {
if ($firstClosed) {
$id -= $cntClosed;
$cntClosed++;
}
tab("close", 0, $id);
$firstClosed = true;
}
$i=""; } ;
Re: close multi tabs
If you need to reset a variable before it's e.g. counted up in a next loop again, just set it to e.g. 0 before
Code: Select all
while ($i++ < $cntTabs) {
...
}
$i = 0;
while ($i++ < $cntTabs) {
...
}
One of my scripts helped you out? Please donate via Paypal