Workspaces are not closing open databases

If I save a workspace that contains one open database (named: oneOpen) then, in the process of my work, when I have other databases that are open, I go to oneOpen workspace it does not close the open databases.

Is this a bug or desired behavior?

Workspaces allow you to save the state of your open databases, as well as the contents and positions of all open windows

This is currently intentional, workspaces open required databases if necessary but don’t close any.

thanks

Would it be possible to add an option in DT to close the databases that are not part of a workspace when switching workspaces ? Or adding this option at the workspace level when creating a new workspace ?

My understanding of worspaces was that it was a way to group databased by concerns/topics.

For example, I have two workspaces (just for the sake of the example):

  • one called “admin” that holds admin related databases: “Archived emails”, “Admin - Personal” and “Admin - Work”
  • another workspace named “Medicine” that holds databases such as “Chinese medicine”, “western medicine”…

I often switch from one to another. But as DT does not close the databases upon workspace change, after one workspace switch, the relation between databases is lost (the ones only worth in the context of admin or the ones in the context of medicine) and unless you remember exactly which databases are part of a workspace there is no way to know. In my example it seems trivial, but when you have several databases, the workspace feature loses its interest if you have to close every unrelated database when switching to another workspace.

1 Like

I’d second this suggestion, at least as an option to close irrelevant databases on switching workspaces.

As it is, you can switch from one workspace to a different one, subsequently update it, and find you’ve included an unwanted database or databases in your workspace update.

We’ll consider this for future releases.

1 Like

Thank you :+1:

Another voice in favour please.

I arrived at this thread thinking the non closure of databases was a bug :slight_smile:

You could use File > Close Database > Close All before opening the workspace.

1 Like

I also got to this discussion because I thought Workspaces not closing DBs was a bug.
Yes, I could use File > Close Database > Close All before opening the workspace but that is more work for my poor, old, tired, fingers …

The real issue arising from the current behavior of not closing DBs for me is from that of search. Could there be a keyboard shortcut to close all DBs except for the selected one.

So another voice in favor of having workspaces remember the specific DBs that should and should not be open.

Could there be a keyboard shortcut to close all DBs except for the selected one.

There is already an available command but a shortcut can’t be mapped to it since the name is dynamic.

This script closes all databases except the current one.

You can assign a shortcut by adding e.g. ___SHIFT + OPT + CMD + W to the filename.

-- Close all databases except the current one

tell application id "DNtp"
	try
		set theDatabases to databases
		set theCurrentDatabase to current database
		
		repeat with i from 1 to (count theDatabases)
			set thisDatabase to item i of theDatabases
			if thisDatabase ≠ theCurrentDatabase then
				close thisDatabase
			end if
		end repeat
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell
2 Likes

Thank you kind Sir.
It works like a champ.

1 Like