Find docs that are marked exclude from search


somehow a document of mine was marked exclude from search and it took forever to find it. once i did, i was able to uncheck it, but i’m noticing some documents are missing from search for me and i’m wondering if that’s the issue. is there a way to find a document that is marked as exclude from search?

As far as I know there’s no easy way to find it.

You could go through every group and manually select each record to see whether it’s excluded in Info Inspector > General. It might be possible to select all records of a group at once, I think the Inspector shows a different symbol if the records don’t share the same Excluded from search state but I can’t test right now.

Another approach would be to simply include all records with this script by @cgrunenberg and afterwards excluding only the desired records.

THANKS! for some reason the script didn’t work for me but this is exactly what i’m hoping to do - a simple script that brings them all to one viewable place.

Yes, if you have two items with different exclusions, the checkbox will show a mixed or indeterminate state.


I’m using custom meta data and Smart Groups to keep track of exclude from classification and exclude from see also. Obviously exclude from search is a special case as it’s not possible to use Smart Groups with them.

However with @cgrunenberg’s template script it’s easy to collect them via tag.

-- Collect all "excluded from search" records via tag

property theExcludedFromSearchTag : "_Excluded from search"

tell application id "DNtp"
		set theDatabase to current database
		set theContents to contents of theDatabase whose exclude from search is true
		repeat with thisContent in theContents
			set tags of thisContent to (tags of thisContent) & {theExcludedFromSearchTag}
		end repeat
		set theTagGroup to create location "/Tags/" & theExcludedFromSearchTag in theDatabase
		open window for record theTagGroup
	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

thank you as always!!

1 Like