Tinderbox Forum

Exporting from Anki, but how to handle images?

I’m a total newbie and perhaps a bit ahead of myself. But thought I would ask if there is a simple solution after I read a lot of what I don’t understand yet in this similar thread.

My simple workflow is to annotate PDFs with anchored notes with Skim. Using Hook, I include a deep link to that same spot. I then manually copy each of those annotations into Anki, with the hook link, sometimes adding screen shots of textbook diagrams. Once the Anki reviews material has settled and began to structure itself in my mind, I export Anki notes as a Tab delimited file and drop it in TB. I find making mind maps much quicker with this mental understanding first.

On export to tab delimited from Anki, of course the actual image from the Anki note is missing. Anki does include some html (I think) in that field (e.g. “<img src=”“paste-3b761a5a8961c6eaa25b3c674b2fade5d521d4b9.jpg”">"). I looked up that Anki actually stores all media in a folder in the Anki application support folder.

Extrapolating how versatile and powerful TB is, I image a wonderful world where I’m not needing to copy and paste those images from Anki to TB. Perhaps there is a way TB can reference Anki’s media folder? Maybe there is a way to copy the media in Anki’s folder to somewhere TB can access? How could all this get linked so TB is pulling existing images or referencing them into notes?

Sorry if this is a very naive question from a new guy. That being said, maybe I need more experience with TB to understand a highly technical answer. At the very least, hope it inspires others’ workflows!

It looks like Anki keeps images at a path like:

~/Library/Application Support/Anki2/[username]/collection.media/

So your image paste-3b761a5a8961c6eaa25b3c674b2fade5d521d4b9.jpg can be accessed at:

~/Library/Application Support/Anki2/[username]/collection.media/paste-3b761a5a8961c6eaa25b3c674b2fade5d521d4b9.jpg

Make a new Tinderbox note, and make the system attribute File a Displayed Attribute (see how). Then paste the above path in as the value of $File. Then, click the folder icon in the File row of the Displayed Attributes table. If you have got the path correct, a Finder window will open showing the image.

So, now TBX doc and image are connected, so to speak.

If the sequence <img src="....jpg"> occurs in exported Anki data with images, then Tinderbox should be to recover the filename. Note: you will need to do some testing, e.g. are all images JPGs or are there other types there too. It looks like—not tested—the regex pattern '<img src=\"[^\"}+\">' should be able to locate the image’s filename in the imported data.

Next, whilst you can paste images into a Note’s text. Whether you should just add loads of images to notes merits thought. Are these images key to the task or only illustrative? If the, I’d leave them accessible to the note via the means above. Why? Tinderbox notes weren’t designed from outset as multimedia spaces as the app is essentially a text annotation/analysis tool. To store the image in the TBX involves storing the image info in the note text in a form that adds bloat to the file size. no big deal if you expect that outcome. But, if adding files, I’d suggest processing them so they are no larger/higher res than needed in app. The is an outstanding feature request to allow in app use of externally stored images.

Does that help?

†. This too is not without problems for the general use as it falls to the user to not move the images from their OS stored location, and not everyone is that organised. No blame there, but acceptance of real vs idealised human behaviour. :slight_smile:

1 Like

This is just amazing @mwra

1 Like

Thanks! This makes sense and is a very clear explanation. I’ll need to play with it this weekend. Everything takes me 3x as long as a newbie. :slight_smile:

Something I just thought of: would it be easier/more logical to capture notes in TB first then export to Anki? I think a CSV would be that route. Just not sure how to export from TB yet.

I’m really struggling conceptually. A lot of answers are “it depends”. So far I think Skim, TB, DEVONThink, Anki, and Zotero are all involved.

Perhaps I’m making it too complex.

Yeah probably :slight_smile: Fun to geek out, albeit!

There are a host of ways to export from Tinderbox and it is very flexible. Unlike many apps, it isn’t a ‘canned’ push-button feature, as you define what is exported. WE can help with that.

The make test manageable, I’d make a small CSV file in BBEdit or such and do some practice imports to Anki. that way you’ll know what the export template needs. When you’ve firmer detail, the forum can help.

Hey there, what exactly is Anki? What is it intended to do?

For, I struggle keeping images in an apps ~/library/… directory. This seems inherently dangerous as it is difficult to back these images up and manage them or use them in another contexts. As noted in many of my videos, I recommend, as Mark points out, having a folder with your images (one I backup with Arq). For maximum flexibility, I parse the path for an image into three parts ($MediaPath, $MediaDir, $MediaFileName) and use a config note (e.g. TBXConig) and local values to manage the display of the image. I have a function that populates the $Hover and $Fill attributes so that I can see the images in map view and on hover. I find this method ideal as I can visually see the image in map view, preview the image, hover a note to see the images, and most importantly export the image to HTML, Word, PDFs, PPTs, etc. I can also have the paths and image file names sent to CVS and excel. Moreover, with this method, I can ass other HTML tags to the image src, e.g. alt, height, width, and align. I can also use markdown to insert images into notes. For anyone interested, I’ll be happy to explain all of this in more detail, or you can simply watch some of my earlier videos.

As I typically have reference 10s if not hundreds of images in my files, loading them in Text is a non-starter. TBX files get too big and the images can’t be exported.

My longstanding request is that the $Fill attribute would support a user-generated path, like $Hover.

1 Like

This would be very useful!

1 Like

Anki is a free, cross-platform, open source, app for doing flash cards for learning. As they describe it (see link):

Anki is a program which makes remembering things easy. Because it’s a lot more efficient than traditional study methods, you can either greatly decrease your time spent studying, or greatly increase the amount you learn.

Anyone who needs to remember things in their daily life can benefit from Anki. Since it is content-agnostic and supports images, audio, videos and scientific markup (via LaTeX), the possibilities are endless.

1 Like