Merging Markdown files

I have a number of Markdown files that I need to merge into one master Markdown file. When I try to do this using the Data/Merge command, it apparently processes the markup in the Markdown files and gives me one consolidated RTFD file, including the actual images that were Markdown references in the original files.

How do I create a Markdown file by merging separate Markdown files? Or is it not possible in DEVONthink?

I am using DTPO 2.9.10

UPDATE: OK I figured it out - convert them all to Plain Text first

That’s not possible right now but scriptable:

tell application id "DNtp"
		set theSelection to the selection
		set theName to ((count of theSelection) as string) & " merged documents"
		set theText to ""
		repeat with theRecord in theSelection
			set theText to theText & (plain text of theRecord) & return & return
		end repeat
		create record with {name:theName, type:markdown, content:theText} in (parent 1 of item 1 of theSelection)
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell

1 Like

That’s great - many thanks!