After 3 weeks of DEVONthink, I am missing the ability to paste image in markdown :(

First, I want to say that DEVONthink is incredible and a very powerful tool.
It is helping me on a daily basis go through my thought process.

But, I really miss my other app that allow me to paste an image on a markdown file.
Breaking my writing by pasting first my image on a folder then link it, is disturbing the writing flow. I am skipping some images just because it’s a tedious task.

Bear, Ulysses, Marked2 … all allow to paste an image within a markdown file.
I think its called TextBundle format.

It will be welcome to DEVONthink :blush:

Per page 42 of the DEVONthink Handbook, what happens when you drag and drop an image file into your markdown document?

Also … any particular reason you MUST write in DEVONthink when you like the other apps?

Echoing @rmschne, you don’t have to write in DEVONthink. The files are stored on disk as normal files (even when you import them into DEVONthink), and most applications should work fine editing them. I use the Data ▹ Open with … menu option all the time to open files in other applications.

1 Like

As noted, DEVONthink 3.8 supports pasting an image into a Markdown document if the Preferences > Files > Markdown > Images option is enabled and a group name specified.

Are you copying from the Finder?

1 Like

This is wonderful, after enabling that option, DEVONthink took care of what I do manually (create a group, paste the image there then link in to markdown)

Thank you a lot for your help,

1 Like

It is indeed a handy feature, even for an old dog like me that prefer to compartmentalize my Markdown in a group structure similar to web content :smiley:

I have collected all the attachments including images in one unique group.
May I Change the folder to a specific group in location? just like Obsidian do?

If you are using DEVONthink’s item links, e.g., x-devonthink-item://…, instead of relative or absolute links, yes you could easily move the images to other groups and they’d still work.

I’m a bit curious whether there’ll be support for pasting an image into a markdown document, and use the devonthink link instead of the relative path to do the embedding?

Thanks for the suggestion! The current approach is actually intentional to improve the compatibility to other apps but we might add an option to future releases.

1 Like

Do you perhaps have a suggestion for moving stuff markdown files around? i.e. how to bring their specific assets with them?

As long as it’s the same database, replicating the assets folder might be an option.

That is not part of the markdown standard. Implementing anything like it in DT would create documents that other MD processors could probably not handle. So not a good idea.

Also, MD is a text format, i.e. human readable. Image formats are not text and not human readable. While it is possible to include an image as text into an MD format (I’ve posted code doing that here), it is not a good idea, either: The MD file gets incredibly large, and the image is a huge blob of unintelligible “text” that makes it difficult to navigate the document.

So no: one simply should not paste images into MD documents. Same as one should not paste images in HTML documents.

1 Like

Keep the Markdown document and it’s assets in their own group. The group can be easily moved as a single unit.

1 Like

FWIW I wrote a simple applescript & KM macro for my need.

set LocalImageFilename to ""
tell application "Keyboard Maestro Engine"
	set LocalImageFilename to getvariable "ImageFileName"
end tell

tell application id "DNtp"
	set PasteImageRecord to (paste clipboard)
	set tags of PasteImageRecord to {"ImageAttachment"}
	set name of PasteImageRecord to LocalImageFilename
	set theurl to reference URL of PasteImageRecord
	set the clipboard to theurl
end tell

Convert Image to Devonthink (1.9 KB)

If I understand your script correctly, it takes the content of the clipboard and saves it as an DT record.

But why do you set the clipboard to the URL of this newly created record in the last step?

If you look at the included keyboard maestro file, you’ll see that it gets passed on to later stage. Now I could use a variable, but this seems to be of lower effort.