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.
- Multiple Listers can be handled simultaneously.
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
IMPORTANT: Requires DOpus v13.15.2 or later
Download the file below. Then go to Script Management (or run Prefs SCRIPTINSTALL
) and select the downloaded file.
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.
show warning for non existent paths: Show a warning when trying to open non existent paths.
delayed tab closing detection: Use a workaround to avoid capturing tabs closed non-manually. Disable it if you usually close tabs very quickly and notice the script doesn't detect that action.
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
.
Once opened, the dialog will automatically "follow" the active Lister, so only one command window can be shown at a time.
The dialog also monitors closed tabs and updates its state in real time.
It includes a few buttons that let you quickly access common actions, as shown in the image below:
Use Ctrl+K to toggle "Keep dialog open" button state.
Use Ctrl+L to toggle "Remove invalid paths" button state.
Use Ctrl+P to toggle pause state for the active Lister.
Use Ctrl+R to toggle "Remove after reopen" button state.
The dialog 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.
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.
@evalalways:closed_tabs=IsSet("$lst:TabRescue_count") ? Val("$lst:TabRescue_count"):0;
@disableif:=closed_tabs==0
TabRescue LIST
You can then use the variable "closed_tabs" in the button's description :
=return "Closed Tabs:" + closed_tabs;
TabRescue.dcf (508 Bytes)
Notes / Technical Details
-
Note that the pause state is set per Lister, rather than globally.
-
You can open only one dialog at a time, since the dialog can handle several Listers simultaneously.
-
Numeric references are disabled when the filter has focus and re-enabled when it loses.
-
The dialog will attempt to display the corresponding icons for the path when possible. This only includes “local” or “shell” paths, as well as some paths with known icons. To avoid delays, it won't try to fetch icons for remote paths. In all other cases, it will show generic icons.
-
Icons may display incorrectly if they've been modified in the system in a non‑standard way.
-
The command implements a workaround to avoid capturing tabs closed non‑manually (e.g., by using a command that manipulates tabs or loading a Tab Group), using a 100 ms timer. This can be disabled in the script configuration (delayed tab closing detection).
-
Maximum number of remembered tabs per Lister is capped at 50 to avoid potential problems from saving very large variables.
Changelog
v2.0.2 (28-May-2025): TabRescue.opusscriptinstall (9.4 KB)
- Fixed filtering of invalid Collections/Libraries when required.
- Fixed certain scenarios where the dialog could appear off-screen.
v2.0.1 (26-May-2025): TabRescue.opusscriptinstall (9.4 KB)
- The dialog has been completely restructured and the code updated.
- The dialog can now handle multiple Listers simultaneously and fully automatically.
- Real‑time dialog updates.
- Buttons have been added as switches in the dialog for some common actions.
- The dialog displays icons for the vast majority of paths.
- Other fixes.
Complete changelog
v1.1.1 (17-May-2025):
- Hotfix for shell path types being recognized as nonexistent.
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.
v1.0 (15-May-2025):
- Initial release.