How do I undo a setting of Exclude from Search?

I created a search that returned some documents. While reviewing them, I marked some to “Exclude from Search”. They disappear. OK, I understand … but … How do I undo this change later (i.e. after I’ve done some other stuff and the Undo menu says “Undo Flag”).

I tried to redo a search. It seems, using the same search terms still excludes the documents. The “Exclude …” seems to be a permanent “fix” to the documents now.

I found this old thread that implies undoing the Exclude is impossible except via Applescript (and even then it may not work).

How do we recover from this “mistake”? Where is the process documented in the Help files? Do we have a “View Excluded Documents” method somewhere?


JJW

You could use this little script to iterate them…


tell application id "DNtp"
	set theContents to contents of current database whose exclude from search is true
	repeat with theContent in theContents
		-- Insert code here
	end repeat
end tell

…and this one to reset the exclusion of all contents:


tell application id "DNtp"
	set exclude from search of contents of current database to false
end tell

Interesting… I approached it similarly. Learn something new every day.


tell application id "DNtp" to set properties of (every record of current database whose (exclude from search is true)) to {exclude from search:false}

``` :smiley:

The script did the trick.

Thank you.


JJW