Looking for a way to copy contents of "See Also and Index" documents and groups to a separate folder

There’s a slew of exchanges here re: use of “See Also and Index” tool, which I perused. One came close to answering my question, but then veered off to solve a related method (of simply creating an RTF or txt file of the names of documents that were the result of a search). I did not find an answer to whether one can gather not just file names, but contents as well, preferably as separate copies or duplicates in a sequestered folder, which can even be simply on the desktop, for other uses, e.g., in Tinderbox or other mind mapping solutions. Sorry if this is indeed answered somewhere. Just point me to it. Thanks.

Please clarify what you’re asking.

  • You want to duplicate See Also documents?
  • There could be many matches, so how many would be duplicated?
  • Are these indexed files?
  1. Yes, unless I am somehow misunderstanding the status and details of “See Also” documents. I can understand the difficulty of capturing the contents of indexed files, and so I assume this is impractical, if not so complicated as to be inefficient.
  2. Not that many files in total. Perhaps a few dozen at most.
  3. Some would be. See my response to 1., above.

My objective is to end up with a more efficient process than manually gathering a list of documents and having the list to refer to in order to use desktop file management tools, again, manually to get the actual files associated with their names into one location, e.g., a folder as a temporary working repository for further deployment to other apps and utilities

Thanks Jim.

I’m on a date right now so i’ll look at this later :slight_smile:

Thanks. I hope your date was enjoyable. I realize I should have said I am interested only in files that are either txt or md in format… My question is too complex an issue referring to formatted text formats, never mind pdf…

An evening of good conversation unrelated to work, so pleasant for sure.

I am interested only in files that are either txt or md in format…

So you have a text or Markdown document selected and want to gather See Also documents related to that selected document, correct?

Strictly speaking, yes. Less strictly (that is, more inclusive of selecting, say, a single pdf document) I’d like to gather See Also documents and move the documents that are the result of the gathering to a single folder, hopefully outside of DTP, and simply a cull of all the Markdown and text documents to be manipulated for other purposes in other environments. If I have to do the “culling” manually, so be it. But I was just looking for a more efficient way of gathering them and then moving them.

Did you know you can select See Also matches and drag and drop them to the Finder?
This preserves the content in DEVONthink.

Here also is a quick script that will export the first 10 See Also matches for a selected Markdown or text file…

property compareAllDatabases : false -- Matches only in current database by default.

tell application id "DNtp"
	set validTypes to {markdown, txt} -- Only process these selected files of these types
	if selection = {} then return -- Do nothing if there's no selection
	set exportLocation to choose folder -- Pick where to export the files externally
	set theRecord to (selected record 1)
	if (type of theRecord is in validTypes) then
		if compareAllDatabases then
			set seeAlsoMatches to (compare record theRecord comparison data comparison)
			set seeAlsoMatches to (compare record theRecord comparison data comparison to (current database))
		end if
		if seeAlsoMatches ≠ {} then -- If anything is matched, export each document to the chosen location
			repeat with theMatch in seeAlsoMatches
				export record theMatch to exportLocation
			end repeat
		end if
	end if
end tell