How to access files in file system (to change markdown headings)?

Hi, I started using MultiMarkdown some months ago and used “###” before and after the header text:

### Title ###

Some Text.

Now it seems MultiMarkdown 6 which came with the latest DEVONthink update handles headers in another way then the previous version used in DEVONthink, as now in rendered view all headers end with “###”

Title ###

Some text.

I want to change this, I’ve got a regex (find “#+ $” and replace it with " " as MultiMarkdown needs two spaces at the end of each line), I’ve got the tools to do it, and I’ve got no idea how to access files inside a database package in finder. What’s the recommended way to process files inside a database package? Without accessing files directly in finder it could be done in DEVONthink with AppleScript using a TextSoap cleaner or with DEVONthinks “plain text” and Satimage Text Additions “change” command (Download), but I’d like to know in general: What’s the best way to access files in the file system for batch processing?

Thought of temporarily moving Files.noindex out of the database package, removing the “.noindex” extension and search all markdown files, but I’m quite sure this is not recommend :grin:

Thought of temporarily moving Files.noindex out of the database package, removing the “.noindex” extension and search all markdown files, but I’m quite sure this is not recommend

You would be correct in this assumption.

Generally speaking we do not advocate accessing the files in the filesystem without DEVONthink’s knowledge. Can it be done? Yes, but we also don’t want to minimize the dangers of creating inconsistencies in the database if you make a wrong step.

The safest option would be to use AppleScript.

What tools are you thinking of?

I meant TextSoaps Batch File Cleaning or BBEdits Multi-File Search if accessed in the file system. But I’ll follow your advice and take the save road with AppleScript. Just to understand this, of course DEVONthink fetches the content of a record when it is first added to a database, and of course it also updates its index when a record was changed in an external app. But where is the difference when a file is changed in the file system? Tried it before your answer with a test database and TextSoaps Batch File Cleaning and it seems to work fine, but I don’t want to rely on this.

In this instance, there isn’t a difference. I personally would drop into the shell and do it, but I also know where I’m walking and where pitfalls are.

As I said, it’s more about not advocating rooting around in the internals of a database casually. But it can be done. In fact, in your case it would appear a bit easier as the Markdown files would be segregated into a specific folder and that folder could be processed.