Close Left/Right Tabs and Open Closed Tabs

Features wanted...
Post Reply
kiwichick
Posts: 557
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Close Left/Right Tabs and Open Closed Tabs

Post by kiwichick »

Hi there,

The "Close All Other Tabs" option is great! I've added it to a custom toolbar button. Would it be possible to add options to close only right or left tabs?

I also love the "Restore Last Closed Tab" option and have added that to a toolbar button as well. Would it be possible to restore more than just the last one?

Cheers.
Windows 10 Pro 22H2

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Close Left/Right Tabs and Open Closed Tabs

Post by highend »

Both wishes can be easily achieved via scripting.

Hints?
1.) Get current tab ID. while loop. Close all tabs with a lower id (left) / higher id (right).
2.) Save path of the tab to close to a file (or permanent variable?). Reload them from there when necessary.
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 557
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Re: Close Left/Right Tabs and Open Closed Tabs

Post by kiwichick »

Thanks for the hints, highend, I'll see what I can come up with.
Windows 10 Pro 22H2

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Close Left/Right Tabs and Open Closed Tabs

Post by highend »

1.)

Code: Select all

/* 20.09.2012, Close all tabs left / right from the current tab
   ::load "<xyscripts>\CloseTabs.xys";
   Author: Highend
   Version: v0.1
*/
"CloseLeftTabs"
  $curTabID = tab("get");
  $maxTabs = $curTabID - 1;
  $i = 1;
  while($i <= $maxTabs) {
    tab("close", 0, 1);
    $i++;
  }

"CloseRightTabs"
  $numTabs = tab("get", "c");
  $curTabID = tab("get");
  $maxTabs = $numTabs - $curTabID;
  $i = 1;
  while($i <= $maxTabs) {
    tab("close", 0, $curTabID + 1);
    $i++;
  }
2.) See http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=8633
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Close Left/Right Tabs and Open Closed Tabs

Post by LittleBiG »

Thanks Highend! I have just realized, that I as well can use it. I have some permanent tabs at the beginning, then the amount of temporary tabs always grow at the end. CloseRight is ideal to close temporary tabs all at once.

kiwichick
Posts: 557
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Re: Close Left/Right Tabs and Open Closed Tabs

Post by kiwichick »

Fabulous highend!!!! You're a star again :appl: Thank you so much!!!

And that's great LittleBiG, I'm glad someone else will find a use for this.
Windows 10 Pro 22H2

Post Reply