Page 1 of 1

Close Left/Right Tabs and Open Closed Tabs

Posted: 21 Sep 2012 00:22
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.

Re: Close Left/Right Tabs and Open Closed Tabs

Posted: 21 Sep 2012 00:29
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.

Re: Close Left/Right Tabs and Open Closed Tabs

Posted: 21 Sep 2012 01:10
by kiwichick
Thanks for the hints, highend, I'll see what I can come up with.

Re: Close Left/Right Tabs and Open Closed Tabs

Posted: 21 Sep 2012 12:23
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

Re: Close Left/Right Tabs and Open Closed Tabs

Posted: 21 Sep 2012 13:13
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.

Re: Close Left/Right Tabs and Open Closed Tabs

Posted: 22 Sep 2012 07:23
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.