I am looking for a way to import files I can generate myself (data coming from another system), like json files, where I can pass along as much information as possible, like
creation date/time
tags
geo location
and these notes also contain media files, like references to images and videos.
I would like to create these files myself and then throw all of them into DT at once.
Any idea how this could be done, which file format would work for this purpose and is this documented somewhere?
This question is so general, that I feel tempted to reply with āyes, is possibleā. More so since DT imports whatever you want it to import. Also JSON. Another quotation entirely is if you can put those data to use in DT, ie If itās searchable.
If youāre thinking about semi-structured data like JSON, why not use a No-SQL database with it?
The reason why I ask is, because I donāt see any telling options in the import menu and which kind of data structures are expected as for note-creation-timestamp, geolocation and so on.
Am I missing some part of the documentation somewhere?
Maybe I didnāt explain well enough. I want to create RTF notes automatically, but want to bring along additional properties and media I mentioned above.
The content of the note is not JSON, it will contain just plain text, prefrerrably formatted with headlines and text blocks.
Like this example:
{
ātitleā: āmy titleā,
ācontentā: āhere comes content, maybe with formats?ā,
āgeo-locationā: " 52° 30ā 58.32 N 13° 22ā 39.72 E",
ātagsā: [ ātag1ā, ātag2ā]
ādate createdā: ā2021-03-14Z12:34:14ā,
ādate updatedā: ā2023-07-16Z18:14:34ā
}
Using JSON as a vector for creating rich text files is a non-standard vector and thereās no direct support for it. (Itās actually the first time I can recall anyone even mentioning it.)
It would be possible via scripting but again, thereās nothing built-in for this.
However, it also feels like killing a fly with a shotgun. Iād suggest you read the Help > Tutorials > Using Templates tutorial, as creating and using templates is a fairly simple affair.
To use that as you described in DT, youāll have to write a script. It must extract the metadata, create an RTF record, set its content and the metadata. Feasible, but may be not practical.
Iād would have to create several 1000 notes this way, so I was thinking along the lines like handling it like an enex-import would handle this, where it finishes importing within a very short amount of time.
Doing this via scripting sounds more like a very slow and cumbersome way of doing this.
I am looking for a way to archive data from an old forum in a way I can still access its content properly.
I have a huge json file containing an entry per post and each entry has the above mentioned meta data and also contains photos.
I can develop a parser to cut the big json structure into small pieces and ofc also transform the format.
Python has extensive capabilities of parsing JSON format data. Perhaps you, or someone you hire, could make some code to do this. From first glance it does not seem too difficult since you know exactly what you want. Just an idea.
You can import pretty much any data into DEVONthink. But DEVONthink does not have unlimited capabilities to present (Preview) the fileās content. Also (probably) does not have unlimited capabilities to index files that the app does not know how to Preview. DEVONthink has built-in capabilities, and the app relies on macOS services. The DEVONthink documentation, and other experts can comment, of course, on this.
If you can parse the data, great first step. Your approach to create RTF files seems ok as you say you have attachments and RTF can handle attachments and previewable in DEVONthink. So, do some trials and see what happens. Parse a few records, some with attachments, into RFT and then import.
After looking into the topic in more detail and the discussion here, I think the easiest way is to convert the data to enex and import that. That would probably be the easiest way to get the bulk import going without much hassle.
JSON is a more modern file format, so I donāt really understand what this should give to you.
For using DT / DTTG you need other formats anyway, like Text, Markdown, RTF or PDF.
This means, you need to extract this content anyway!
Converting from JSON to ENEX is unnecessary, I believe.
I just did something similar with JSON exports from the Drafts App, to get Markdow files from this - I needed āmillerā (mlr) and ājqā to accomplish the conversion from JSON to Markdown in a bash script, but it worked great!