How to Search All?

Just wondering how to easily search all databases – the way users were able to do so in DTP2. Would welcome any suggestions…

Thanks!

Have you tried a search?

Yes. Certainly.

When I contact a search in DTP3, it seems that I’m forced to select a single database – and then I can adjust the setting to broaden the search so that it can include others. Isn’t this the default way that the Search is set up?

In DTP2, it seemed that I was able to hit Command+Shift+F (as I recall) which opened a new window, and enabled me to conduct a Search across all open databases. I’m wondering if it’s possible to do something similar in DTP3 – and if so, what settings I need to employ.

Thanks.

When you do a search, the scope bar appears under the toolbar. That’s where you specify the scope, i.e., the location you’re searching.

This is covered in the Help > Documentation > Windows > Main Window > Search Pane.

Thank you. I understand that. Sorry if we’re going in circles here, but I’m wondering if there’s a way to set up the search so that when one hits Command+Shift+F it can: (a) create a new window, and (b) defaults to a Search that will look through all open databases.

Is this possible to set up? Thanks!

1 Like

It’s not possible without a script (or Keyboard Maestro).

As it’s not possible to create a new window via AppleScript without telling DEVONthink the target of the new window this script uses the built-in groups as targets. Using built-in groups limits the creation of new windows to 3-4 if no database is open (should be no problem as you want to look through all open databases).

If you want new windows to appear above an existing main window set property theBounds to {}.
If you want them to appear at a specific position use this

helper script
-- Get bounds of main window

tell application id "DNtp"
	try
		set theBounds to bounds of viewer window 1
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
	end try
end tell

to get the bounds of the frontmost main window and set property theBounds to the result.

The shortcut Command+Shift+F is used by DEVONthink so you first need to assign another shortcut to Format->Show Formatting Bar via System Preferences or CustomShortcuts app. After that adding ___SHIFT + CMD + F to the script file name should work.

-- Open new window and focus search field

property setBounds : true
property theBounds : {142, 101, 2418, 1337}

tell application id "DNtp"
	try
		if viewer window 1 exists then
			set windowCount to (count viewer windows)
			
			set theUUIDs to {}
			repeat with thisDatabase in viewer windows
				set end of theUUIDs to uuid of root of thisDatabase
			end repeat
			
			repeat with thisDatabase in databases
				if (uuid of root of thisDatabase) is not in theUUIDs then
					open window for record (root of thisDatabase)
					exit repeat
				else if (uuid of annotations group of thisDatabase) is not in theUUIDs then
					open window for record (annotations group of thisDatabase)
					exit repeat
				else if (uuid of incoming group of thisDatabase) is not in theUUIDs then
					open window for record (incoming group of thisDatabase)
					exit repeat
				else if (uuid of tags group of thisDatabase) is not in theUUIDs then
					open window for record (tags group of thisDatabase)
					exit repeat
				else if (uuid of trash group of thisDatabase) is not in theUUIDs then
					open window for record (trash group of thisDatabase)
					exit repeat
				end if
			end repeat
			
			if (count viewer windows) > windowCount then
				if setBounds = true then
					if theBounds ≠ {} then
						set bounds of viewer window 1 to theBounds
					else
						set bounds of viewer window 1 to bounds of viewer window 2 as list
					end if
				end if
			else
				display notification "Not possible"
			end if
		else
			open window for record (root of current database)
			if setBounds = true then if theBounds ≠ {} then set bounds of viewer window 1 to theBounds
		end if
		
		activate
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
	end try
end tell

activate application id "DNtp"
tell application "System Events"
	tell process "DEVONthink 3"
		repeat with i from 1 to 10
			try
				set focused of text field 1 of group i of toolbar 1 of window 1 to true
				exit repeat
			end try
		end repeat
	end tell
end tell
1 Like

Thank you so much for all of this, @pete31 – I greatly appreciate it, and I’m sorry for my late reply.

I’ll take a look into this, though it requires more work and building than I expected. While I greatly appreciate how much you’ve outlined here, I wish this feature (which existed in DTP2) remained in DTP3. It was one of the features that I used the most, and I don’t understand why it doesn’t exist anymore. As much as I love many things about DTP3, the new search function just doesn’t feel as easy to use and robust. And it’s disappointing that users have to build a hack solution to compensate for its absence.

Anyway, I’ll put this on my to-do list, and will circle back to you about when I’m able to tackle it.

Many thanks again…

I would agree with the original poster here.

When I search, I almost always want to search in All Databases, and it seems reasonable to have this as a default. This was functionality that was seen in DT2.

Bluefrogs suggestion whilst providing a solution seems to add friction. To get to all databases requires 2 clicks and two mouse moves. Imagine doing that 30 times a day.

1 Like

Thank you.

Again, I greatly appreciate the wonderful improvements in DTP3, but I do miss the old Search function and the separate panel – it was much easier to use and navigate compared to the way that it’s now integrated into DB windows in DTP. I just feel like the Search’s UX design doesn’t work well, and I’d really like DTP to bring back it’s design and functions – or something that’s akin to them. Here’s hoping…

Thanks!

1 Like

Gonna throw my $0.02 in as well and state that a more global search by default seems like the logical way the search should be handled. I have been searching online for a good 20-30 minutes trying to find a way to simply default to that behavior because that is what makes sense.

1 Like

Thank you. I’m in complete agreement with you, of course. I love many of the changes that they made in DTP3, but I definitely feel that the search in DTP2 was much better and easier to use. I truly hope they bring it back. It’s pain to do complex, far-reaching searches with the existing global search framework.

1 Like

Welcome @MichaelMcDonald

a more global search

I’m not sure what you mean by this.

@jprint714:

It’s pain to do complex, far-reaching searches with the existing global search framework.

In what way?

I’ll explain the part of the text that refers to me. In general, it’s much easier to have one complex search window, with all of its search options within that window, that spans all of the databases in the way the DTP2’s global search interface existed. In my view, it was a perfectly constructed and designed search window – and was better than the way that DTP3’s global search works. Again, I think many of us fully applaud DTP3’s design, but still pine for the old global search pane/setup.

Hope that’s helpful…

I’m not sure how the old window way “way better” as the new toolbar search field in combination with the scope bar and Navigate sidebar is far more versatile and capable. And that’s ignoring the powerful search prefixes in DEVONthink 3.

Ok, it seems that with the DTP3 search window it’s not at easy to simultaneously search all databases. Am I wrong?

Also, personally I like having a separate search window, rather than having it affixed to the database window itself.

1 Like

with the DTP3 search window it’s not at easy to simultaneously search all databases. Am I wrong?

When you search, the scope bar appears under it and you can easily select All Databases.

personally I like having a separate search window, rather than having it affixed to the database window itself.

The majority of input we’ve received over the years was ”you have too many windows in DEVONthink. Fewer windows! Single window interface!”

1 Like

This is the crutch of my issue though: I have to make a change, I have to select that I want to search all databases. Why limit the scope of the search initially? A global search by default seems to make more sense (IMO).

Perhaps an option to choose the default behavior: search globally in all databases / search in local database. That would solve the issue!

1 Like

The request is noted.

2 Likes

Well, I still enjoyed the separate, standalone search window – with the default to a global search that spanned all databases. Thanks.

2 Likes

Please note that I have the same request! I’ve been assuming all along that searching globally in all databases was the default. Only recently have I discovered that I have missed many documents over the years because I should have made a second choice to that effect.

1 Like