Exporting/Printing with Names

I have a DB folder consisting of rtf(d) files, and I want to export or print the entries in that folder as a single file WITH the Name of each entry included. Can I do that? and if so how? The Export menu entry won’t give me the Names, AFAICS. A more general question: is it possible to include ANY of the info in the different columns in the printout?

Do you want a list of document names, or a list of document names + the contents of the documents? If the former, then try the script in the scripts folder at Scripts > Export > Listing. This creates a plain text listing of the document hierarchy, by name, in your database. It can easily be edited to the list for one or more groups.

Thanks, but I need the names + the contents. The folder is a collection of jottings/notes on various topics, and is meaningless without the Names I’ve given them.

Here is a script that creates a new document with the names and the plain text content of selected items in a group. Maybe you find it helpful. (It is basically a modification of one of Christians scripts).


using terms from application "DEVONthink Pro"
	tell application "DEVONthink Pro"
		if not (exists think window 1) then error "No window is open."
			set theSelection to the selection
			set theGroup to current group
			set theText to ""
			repeat with each in theSelection
				set theText to theText & "• " & (name of each as string) & "
" & (plain text of each as string) & "

			end repeat
			create record with {name:(name of theGroup as string), type:txt, plain text:theText} in theGroup
		on error error_message number error_number
			if the error_number is not -128 then
					display alert "DEVONthink Pro" message error_message as warning
				on error number error_number
					if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
				end try
			end if
		end try
	end tell
end using terms from

This is excellent, Johannes. Many of us can use this, in addition to the OP. Thank you.

Thanks, Johannes, this does the trick. It loses a few diagrams and pics in the rtfds, but for what I need at the moment, it works just fine.

It would be nice to see something like this included as an option under the Export menu in a future version of DT.

I want to make the record created at the end of the repeat-with loop portable - usable outside the current database. I believe I want the record to be rich text, and to modify Johannes’ script to assign the document url (“x-devonthink-item://” & UUID of each) to the name of each record in the selection. So that we would have record name as a clickable URL + record text, repeated for each item in the selection.

So far, no joy. I’m trying to change the URL property of the variable where I’ve placed the name of a record. Is this possible?