TabRescue : Quickly restore your closed tabs

TabRescue is a script add-in command for Directory Opus that implements a new system to manage recently closed tabs.

  • Lets you save a history of closed tabs per Lister.
  • Shows a list of the last x closed tabs, letting you reopen them easily with modifier-key support.
  • Maximum saved-tabs count is configurable per Lister.
  • You can customize how a tab is reopened.

:warning: IMPORTANT: READ BEFORE PROCEEDING

This script is provided "as is" and without any kind of warranty.
It was developed during my spare time and has not been extensively tested, so it is presented as a testing version.
The user assumes full responsibility for its use and acknowledges that the author is not liable for any failures or data loss.
Please note this is a work in progress, so bugs may occur.
Feedback on possible improvements or bug reports is highly appreciated.

How to Install

:warning: IMPORTANT: Requires DOpus v13.15 or later
Download the file below. Then go to Script Management (or run Prefs SCRIPTINSTALL) and select the downloaded file.

v1.1 : TabRescue

Options

In the Script Management window, select TabRescue and click the Edit button.

log level: Logging level to display.
max tabs per Lister: Maximum number of closed tabs to remember per Lister.

As for the key qualifiers, you can set how to reopen a closed tab in the 'Go Qualifiers' section:

none: Specifies how a closed tab is reopened when no key qualifier is held down.
alt: Specifies how a closed tab is reopened when the Alt key is held down.
shift: Specifies how a closed tab is reopened when the Shift key is held down.
ctrl: Specifies how a closed tab is reopened when the Ctrl key is held down.
alt+ctrl: Specifies how a closed tab is reopened when the Alt + Ctrl keys are held down.
alt+shift: Specifies how a closed tab is reopened when the Alt + Shift keys are held down.
ctrl+shift: Specifies how a closed tab is reopened when the Ctrl + Shift keys are held down.

Usage

You can show a list of recently closed tabs in that Lister, by using TabRescue LIST.

TabRescue also supports the following arguments:

Command Arguments

Argument Type Value Description
LIST /O Shows a list of recently closed tabs, from which you can reopen them.
checkifexist Discards nonexistent paths when displaying the list.
LAST /S Quickly reopen the latest closed tab in the Lister.
PAUSE /S Pause the command, so it won't register any new closed tab.
UNPAUSE /S Unpause the command.
TOGGLEPAUSE /S Toggles the command’s pause state.
CLEAR /S Clear closed tabs list for the Lister.

The command also exposes a Lister variable (TabRescue_count) that lets you know how many closed tabs are currently saved, which is useful when creating buttons and defining their state.

For example, you could include this at the start of a button to disable it when no closed tabs exist in the Lister, since it wouldn’t make sense to show the command's list.

@eval:closed_tabs=IsSet("$lst:TabRescue_count") ? Val("$lst:TabRescue_count"):0;
@disableif:=closed_tabs==0
TabRescue LIST

The command's list allows quick filtering by tab name or path, and you can easily clear the list.
Use Up/Down to navigate the list.
Use Enter to open the selected item—the way the tab reopens depends on the modifier keys you use and their configuration.
Use F3 to focus the filter.
Use Esc to close the command dialog.
Use numbers from 0 to 9 to directly refer to an entry. Modifier keys apply as well. That is, pressing Ctrl+0 will open the path numbered as "0" , using the action defined for the "Ctrl" modifier.

Notes / Technical Details

  • Note that the pause state is set per Lister, rather than globally.
  • You can open only one command's list per Lister.
  • Numeric references are disabled when the filter has focus and re-enabled when it loses.

Changelog

v1.1 (16-May-2025): TabRescue.opusscriptinstall (5.7 KB)

  • Now the command will position its window more appropriately in case it would otherwise appear off-screen.
  • You can now reference a numbered entry by using the corresponding number key (0 to 9). Modifier keys also apply in this context.
  • Added some basic protection when trying to open invalid paths.

v1.0 (15-May-2025):

  • Initial release.
10 Likes

Hi,

I've just had a brief play with your new script. At the moment, the TabRescue dialog box opens beside the button on the toolbar, which means I have to drag the box up as I keep my script buttons etc at the bottom of the lister window. It would be better for it to open in the centre of the active DOpus window.

1 Like

I installed this today and have used it for a couple of hours.
It is very well thought out and so far works perfectly.

I added the closed_tabs count to my button label.
I also included the key qualifiers in the button info tip description using \n for new lines.

Thankyou !

@Rebel154 I’m at work right now, but when I get home I’ll update the script to avoid that. Thanks for the feedback!

Hi, I installed this script and it works fine. What do I need to change to open a closed tab in a new one? Thanks.

In a new Lister? Or a new tab?
You can tweak that in the Script Config (use Prefs SCRIPTS=TabRescue.js* to quickly go there) —just change the "none" value to "New Lister" or "New Tab"

Is it possible to open links in new tabs by middle-clicking multiple times without closing the TabRescue window?
And is it possible with multi-selection or box selection to open selected multiple items in new tabs via the right-click menu or Enter key?

Not currently.

because
  1. There is no recognizable event for middle clicking in a dialog.
  2. If the dialog won't close when a tab is reopened, should it remain open until the user closes it? And what would happen if the dialog is open and a tab is closed? Should the dialog auto update its content?
  3. I imagine that multiple selection and reopening could be implemented eventually. Although the command itself is quite old and has only been updated slightly before publication. I will consider adding it if there are more similar requests.

Thanks, perfect

v1.1 (16-May-2025):

  • Now the command will position its window more appropriately in case it would otherwise appear off-screen.
  • You can now reference a numbered entry by using the corresponding number key (0 to 9). Modifier keys also apply in this context.
  • Added some basic protection when trying to open invalid paths.
2 Likes

This version cannot open "This PC".