Automatically import contents of specified folder in Finder to DTP

Hello all,

First time poster. I am new to DEVONthink having recently purchased DT Pro during the last Winterfest sale.

I am using DTP as well as DTTG, my main use case being journaling, reading and annotating PDFs, and saving web pages as of now.

This post is concerned with journaling as I tend to write everyday and the note taking experience in DT is not very straightforward. So what I saw as a solution was to write/ edit my notes in an external markdown editor which will save all my notes in a specified folder on mac, and let those notes automatically be imported to my “journal” group in DT. It should be an “import” and not index. Also DT should be able to watch that folder continuously so that any new files are automatically imported and already imported ones are not duplicated again.

I tried to find a solution in the manual as well as in this forum but couldn’t find a satisfactory answer.

Is this even possible? And if not, what would be the most efficient way to get this done?

Kindly note that I am a tech noob and so may not be able to write scripts or things like that.

Best regards.

Is there a reason for the external folder, and using an external editor instead of the DT editor?

the note taking experience in DT is not very straightforward

Why?
DT/DTTG works well for my journalling (I don’t use markdown)

1 Like

You can index the folder into your global inbox and then set up a smart rule that moves the files arriving there to the group(s) in your database.

Something like that (sorry, my DT displays in German as that’s my locale setting):

  • Scans is a folder that I indexed in my global inbox. Change that to the name of your folder where you store your MD files to import into DT
  • Art ist Bild should be set to Kind is markdown (or whatever your locale’s term for “Kind” is)
  • The following Alle (“All”) condition should be removed
  • In the Aktionen part (“Actions”), you should only use Move to (the last one) with the database/group you want for your journaling files as target

For more info on journaling, you might want to search for posts by @Stephen_C in the forum.

2 Likes

I’m not the OP, though I find DT’s built-in editor less “beautiful” than many alternatives, including Obsidian (with a proper custom theme). There are disappointingly few customization options: no settings for line height, maximum line width, customizable appearance of markup elements, among others shortcomings.

Personally, I don’t mind the UI experience when I take notes in a scratchpad fashion. However, an aesthetic and customizable UI does matter for journaling.

A better editor, along with better EPUB support, are all I wish to see in DT4.

Well, probably because I am coming from 3 years of using Bear and also tried my hands on Obsidian and Upnote. All those apps provide a better typing as well as reading experience.

Having said that, DT editor is also fine, but the biggest gripe for me is to not be able to render MD preview in real time which makes the typing experience more pleasant. (just my view of course).

Thanks for the helpful tip. Will the notes after reaching their final destination group remain indexed or will be imported?

They are imported. That’s the whole point of move to.

The only tip I’d pass on to the OP at this time is to ensure that, from the beginning, you have your individual journal entries usefully named in DEVONthink. For example, for me at least, it’s essential to be able to order them easily by date. If you want to do that take a look at part of this old post of mine (the first paragraph under "important warnings”).

If you get that sort of thing right, at the start, it saves much pain later.

In passing, other joys of journals in DEVONthink are DEVONthink item links to other journal entries (i.e., cross references in your journal entries) and the ease of adding photos (if, of course, you wish to do so).

Journals in DEVONthink, if not actually journalling in DEVONthink, are a wonderful resource. I wish you much luck and enjoyment.

Stephen

3 Likes

My journaling is a little convoluted. All journal entries are created initially in the Drafts app. These are then sent to an IA Writer cloud folder using a Drafts action which adds the date and day as a heading and creates a file with the name as date and day. If I add another entry via Drafts, this is appended to the IA writer file.

I then edit the day’s entry in IA writer. Why? 1) I find the interface easier. 2) IA writer and drafts is on all my apple devices so I can journal on any device near instantly (without having to keep syncing like with DTTG) 3) I tend to use IA writer (almost) exclusively for my journal writing so when I open it, it is showing my journal directory in IA writer.

Like @chrillek suggests, my IA writer iCloud directory is indexed into DT. I have a smart rule that runs to move the entries into a DT group as imported. It moves entries after a number of days to give me time to finish adding and editing them.

In summary:

  • Drafts app to initially create a day’s entry and add notes as the occur to me on the fly
  • IA writer to edit and embellish the day’s entry
  • Smart rule to import finished entries into DT at intervals

FYI - at the end of the year I publish my diary into a printed book for the year. Something to pass on to my kids…(though they will probably bin them :joy:)

3 Likes

Just noting this comment and aesthetics are very subjective :wink:

3 Likes

That is an awesome idea! What service prints them?

Welcome @addee :smiling_face:

We probably have different preconceptions—especially when new to DEVONthink—so it’s good to be specific.

I too was not really sure what you meant with

since that’s a bit vague and could refer to different things. I don’t journal in DT myself. But I know many do, and I have been wondering if I should start doing that as well.

To me it seems straightforward enough: Create a file, start writing! You can use placeholders and templates (even smart templates) to automatically fill out metadata like date and time before you start writing. Many things are possible and smart templates can get pretty elaborate, but that’s not necessary at all.

Whether you enjoy the built in text editor is, in my mind, distinct from how straightforward it is :wink: I personally really dislike “to render MD preview in real time”. Still, I prefer a different editor a lot of the time for some of the same reasons as meowky; most importantly a maximum line width. (Planned for a future release according to the developers.) I also enjoy the typewriter scrolling and focus mode of iA Writer, which is my favorite digital writing environment.[1]

I’m curious why having DEVONthink watch an external folder is your preferred solution? Importing files is the default for a reason, but indexing makes sense in some cases. This might be one. Like @saltlane, I keep my iA Writer folder in iCloud indexed.

Or… you could just create the file in DEVONthink, but still use an external editor? That skips the whole import process. In the preferences, under General > Interface, you can enable the option “Double-click opens documents externally”. I just use the default keyboard shortcut ⇧⌘O (Command-Shift-O) to open files externally. Just make sure the editor you want is set as the default application for markdown files.[2]

If you create the files in DEVONthink, you get the benefits of placeholders and templates, but you can still easily use your preferred editor.


On Smart Rules and such

DEVONthink really has a terrific manual :smiley: If you are in doubt about some detail, like the Smart Rule action @chrillek mentions, you will generally find a clear explanation in the Appendix. If you look under Appendix > Smart Rule Events and Actions > Actions, you will find this description:

Move Into Database: Moves indexed items into the database, essentially importing them. Note this removes the file from the original location in the filesystem.

Pro Tip: download the manual in PDF form here and put it in you main database or Global Inbox. Add it to the favorites section of the sidebar. You don’t need to read all of it in one go (or ever), but now you can quickly open and search it with DEVONthink’s search inspector. And since it’s PDF, it’s easy to highlight, annotate and refer to in notes. With item links you can even link to specific locations in a PDF (a page or a precise string of text).


  1. Ironically, perhaps, iA Writer gives you very few customization options. That’s the point, though: it helps you focus and not fiddle with settings. The team consists of typography nerds with a strong background in design. They spent a lot of energy making the defaults great. It looks simple, but every detail is a considered choice. For me, nothing comes close. ↩︎

  2. Not all applications work with traditional files. Some use an internal database (not in the DEVONthink sense). E.g. you can’t use Apple Notes to open a specific text file. To my knowledge the same goes for Bear: it doesn’t work with separate files and only lets you import/export files. ↩︎

3 Likes

That was writing. As for the

– that’s all a matter of stylesheets and CSS, since markdown is rendered as HTML. DEVONthink actually gives you more control here than many. The possibilities are practically endless.

If you’ve never heard of CSS, it might seem daunting. But the basics are pretty easy, and @chrillek has written a nice beginners’ guide here: CSS for Markdown, the basics

You can also try searching the forum; some users have shared their stylesheets for others to download.

1 Like

Indeed. That’s why customization is important. CSS does that for the rendered view. Although we probably can’t get unlimited customizability in the editor view without implementing a full CodeMirror (as Obsidian does), some limited control will still be well appreciated.

I’d agree to that guess :wink: However, there are a few changes to the source view being investigated.

1 Like

It’s a bit of effort…I use scrivener to turn all the markdown journal entries into a word document and then use the self publishing service Blurb. I suspect other services are available to do something similar. Blurb provides free laying out software.

Very nice. Thanks for the follow-up!

That’s great. Will try this and see if it works for me. Thanks again.

Yes they are. But what’s not subjective, for instance, is the ability to change line spacing. Increased spacing can lead to better legibility of the text. Currently the text feels very cramped up on DTP and as a workaround I have to increase the font size 2-3 points above default which is not an ideal solution.

Thanks. I checked your post (just the first para though :slight_smile:). I am already using the exact same naming convention.

1 Like