actant 22 Posted July 24, 2023 Share Posted July 24, 2023 Below is an image of the source code of an .enex file. The note has two local images. The <en-media> tag uses a hash code as the "url" for each local image. Do you experts know how EN maps a hash code to the image resource? In other words, if I generate an .enex file from my resources, how can I generate a hash code as the "url" to the local image resource? Thank you! Link to comment
Solution eric99 1,077 Posted July 24, 2023 Solution Share Posted July 24, 2023 41 minutes ago, actant said: Below is an image of the source code of an .enex file. The note has two local images. The <en-media> tag uses a hash code as the "url" for each local image. Do you experts know how EN map a hash code to the image resource? In other words, if I generate an .enex file from my resources, how can I generate a hash code as the "url" to the local image resource? Thank you! "...Those inline images are CDATA encoded base64 strings. They don’t include a hash, but I figured out that decoding the base64 string and then running it through MD5 generates the hash that is used in the corresponding <en-media> tag..." https://simonwillison.net/2020/Oct/16/building-evernote-sqlite-exporter/ So, as I read this, it's a MD5 calculation on the raw image data. 1 Link to comment
Evernote Expert agsteele 3,056 Posted July 24, 2023 Evernote Expert Share Posted July 24, 2023 The local copy of the data file - image in your example - has a similarly numbered filename but lacking the file suffix. So I have a PDF file in one of the directories in the form 004471xc######################## It sits in the resource-cache\User123456\004471xc-####-####-####-############ If I want to open that outside Evernote then I need to copy that and add the appropriate file suffix so that it will open in a file viewer. Do tell us what you are hoping to achieve and it may be that we can give a more useful response. Link to comment
actant 22 Posted July 24, 2023 Author Share Posted July 24, 2023 @eric99 Thank you for sharing! @agsteele I just want to write an .enex generator to organize some texts and images into an .enex file which is then imported to EN. Link to comment
Evernote Expert agsteele 3,056 Posted July 24, 2023 Evernote Expert Share Posted July 24, 2023 I'd say @eric99 has pointed you in a useful direction. 1 Link to comment
eric99 1,077 Posted September 4, 2023 Share Posted September 4, 2023 Just FYI, this is the offical ENML doc: https://dev.evernote.com/doc/articles/enml.php#added Now that I've written my own html exporter, I'm even more impressed with the ENEX format, a very strict note description format, with no ambiguities like the free style markdown dialects in other note taking apps. 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now