Combining Files

Thanks for all your help so far.

Is it possible to combine multiple text files or markdown files into on file?

Tools > Merge Items

Merge Items: Merge the selected documents into one. This creates a new file, preserving the originals. Hold the ⌥ key to choose Merge & Delete n Documents, removing the original files after the merged document is created.

You’re welcome :slight_smile:

Yes. As noted in Help > Documentation > Menus > The Tools Menu

The Merge command is also available in the contextual menu in the item list.

Thanks pete31 and BLUEFROG for your help when I asked something I just should have found my self.

There is a alot of material to cover and I want to get productive already with this great tool.

No worries. As I’ve said often, do not try to master DEVONthink. Use it for what you need to use it for and allow yourself time to explore on occasion.

1 Like

Good advice, though hard to follow.

though hard to follow.

What part is difficult?

Not delving in too deeply but rather staying focused on how I can use it for my needs.

I think that if I spend a little more time mastering the capabilities I would save myself a lot of time in my work flow.

I think that if I spend a little more time mastering the capabilities I would save myself a lot of time in my work flow.

Trust me, you’re not going to master the capabilities. DEVONthink is similar to Photoshop: both are deep. I have over 25 years in Photoshop and have a bunch of arcane knowledge about it, but am not a master as it’s too deep to know everything. Similarly. I have over 24,000 working hours in DEVONthink and haven’t mastered the application. I learn things about it every week, and have for 8 years. (@cgrunenberg is the person that is the closest to mastering it, but he’s also the creator and developer.)

I would save myself a lot of time in my work flow.

I would argue you’ll be more productive using DEVONthink as you need it now and exploring on your off-time.

@BLUEFROG Thanks for sharing your thoughts and experiences.

You’re welcome.

This thread is a bit old now, but I’ve been wanting a way to do a kind of smart combine. For example, I’m a writer who would like to have chapters (md for example) in a folder combined just for output. I can then send this virtual output file to Marked 2. I could then somewhat replicate what is done in scrivener without actually using scrivener. Is there something like this? (of course I can do the combine, output that, take a look, then delete the file, but ‘interactive’ is what I’d be looking for if possible). Cheers!

Sorry but no, there is no such functionality in DEVONthink at this time. Perhaps in a future version.

This isn’t the smoothest procedure (though you could automate it easily enough and in any case the steps are simple…), but can’t you make use of Marked 2’s ability to include files.


  1. Create a ‘header’ markdown file with the introductory text.
  2. Drag the chapter files into that header file — this will put their filenames and paths into the text.
  3. Add {{ to the front and }} to the end of the paths/filenames
  4. Open in Marked 2.

E.g. For a DT3 folder, with one header file and four individual chapter files, steps 1 and 2 turn into:

Either use the find command:

  1. Find /Users and Replace All with {{/Users
  2. Find .md and Replace All with .md}}

(Or just add the {{ and }} manually to one line, then copy and paste it and change the chapter titles manually).

Either way you get:

Finally, open in Marked 2 and you get:

Obviously you’ll have to juggle heading levels and page breaks to fit your document, but you’ll be doing that anyway. The Marked manual has a section of how to use included files in this way.

Once you’ve set the header file up, adding a new chapter / rearranging the order is as simple as copying and pasting and renaming: not perfect, but perhaps it may be worth looking at?

Brookter, Thank you so much for going to the trouble of outlining that workflow. Not sure it’s the easiest, as you mention, but in a pinch could work. I can actually do a similar thing in IA Writer but haven’t tried it with outputting to Marked. I was just hoping it was something that could be built into DT. I wouldn’t think development on such a capability would be particularly difficult, but what do I know. Is there a macro language that works with DT? Anyway thanks!!

I’m glad it was food for thought! I thought it was worth trying to see how difficult it would be. I think after the first couple of minutes to set it up, adding / rearranging chapters would be trivial: a few seconds at most, because all you’re doing in rearranging lines in a markdown file. Getting the final output to be a coherent document (all the references, heading levels, page breaks etc) is going to be the difficult bit, but you’re going to have to do that anyway if you’re going down the multiple document compile to one route. (That’s why I stick with Scrivener :grinning:)

I’m sure you could automate the initial setup though—probably with AppleScript, but I’d probably start off with a Keyboard Maestro macro and see where that got me…

Good luck with finding something that works for you!

1 Like