So I have tried importing my notes from onenote to obsidian using “importer” plugin. I can see the notes in obsidian but the same note doesn’t display the image on dt4 , I think it’s because the image isn’t linked in wiki link [[ ]] , it is in ![ ]() format , how do I convert all the image links from this to [[ ]] so that it can be displayed on dt4.
![]() is the correct MD format to refer to images. There’s nothing between ] and (. Why would a wiki link be needed to display an image?
ok, so how do I get it images in a note to show up on dt4 ?
this is the same note after importing into dt4
The image(s) must be in a sub-group named Attachments. And no, this has nothing to do with DT. It is just how links work.
I have imported the attachments folder into the database also.
A screenshot showing where in the database your document and the attachment group are located, would be helpful.
Your path is wrong. Yours is pointing at a subgroup in the parent group of the document, as discussed in the Documents > Markdown Documents > Linking section of the built-in Help and manual…
So yours would be e.g., .
I don’t know how to change all the links in bulks, have more than 1500 notes. so I put all the notes and images without folders/groups directly in the database. Its showing up the images now but my organization is messed up.
I have 3 notebooks in OneNote with many pages, images, and attachments: would there be a possibility to automate the import (or backup) of these notebooks into Devonthink? As far as I have understood this thread, you have done it via Obsidian. I do not use Obsidian. Manually importing isn’t an option. thank you
I couldn’t find any other way to do it on Mac OS.
I was a heavy one note user on windows pc .
There’s a batch export script that exports all one files into docx or pdf on GitHub. Or you can use one note gem app to export everything on windows pc.
And there’s
which might be a tad more useful in DT than PDF or Word.
How did you get this to work on Mac OS ?
I did not. I just found the thing on Github. If someone really needs it, they might try with a virtual Windows machine on macOS.
You could do that with a little regular expression and some JavaScript:
/*
Turn relative image links: 
Into absolute image links: 
*/
(() => {
const DT = Application("DEVONthink");
DT.includeStandardAdditions = true;
/* Use group selector to choose the top-level parent
containing all markdown documents with links to fix: */
const p = DT.displayGroupSelector();
const pLoc = p.locationGroup() === null ? p.location() : p.locationWithName();
/* Get array of documents with a 'whose' filter:
(alternatively, we could use 'search') */
const records = p.database().contents.whose({
_and: [
{_match: [ObjectSpecifier().recordType, "markdown"]},
{location: {_beginsWith: pLoc}}
]
});
/* Loop over documents, doing a global RegEx find & replace: */
let fixCount = 0, skipCount = 0;
records().forEach(r => {
const badLinks = /!\[Exported image\]\((?=Attachments\/)/g;
const txt = r.plainText();
if (badLinks.test(txt)) {
const newTxt = txt.replaceAll(badLinks, ";
r.plainText = newTxt;
fixCount++;
} else {skipCount++}
});
DT.logMessage(
`Fixed bad relative image links in ${fixCount} markdown files.`
+ `\n(${skipCount} files skipped, no image links)`,
{record:p});
})()
This would replace every occurrence of (?=Attachments\/)/g;
.
.
.
const newTxt = txt.replaceAll(badLinks, "/");
Note: I only tested on a group with a single document; I don’t have 1500 files with bad links lying around. As always, it’s a good idea to test on a copy first.
Edit: The script didn’t work if you chose a database in the group selector instead of a group. I adjusted it a little to also work in that scenario.
Thank you so much!
You’re welcome! ![]()
Maybe you could share a link to the importer plugin? (And a few notes on how you configured it, if you did anything special?)
Maybe a Microsoft OneNote import/backup feature could be integrated in DTP? @cgrunenberg please regard this as a kind feature request. Would be really useful.
Microsoft offers an API to OneNote. It seems to be RESTful, and you need an ID to be able to use it. There’s some python code on Github that might be helpful: OneNotePyAutomation/onenote_auto.py at main · awaldis/OneNotePyAutomation · GitHub
It may be possible to recreate that somehow, but is the number of people who want to migrate from OneNote (a Microsoft product) to DT (Apple only) so big that it’s worth the effort?
And information on the Obsidian importer stuff is easily found by an internet search: Import from Microsoft OneNote - Obsidian Help
It has some issues with Microsoft 365 accounts, though.
Ah. I don’t use OneNote and haven’t been following Obsidian very closely, so I didn’t realize this was practically a core plugin with its own page in the official Help. I just remember there being an ocean of plugins, so I tried to nudge OP to share which one he used.
@vinschger even if you don’t use Obsidian, what’s the problem with installing it for this purpose? It’s free and you can just get rid of it when you’re done.




