If you have a general support-related question, please feel free to post it here.
If you run into a bug and are familiar with GitHub, please consider filing a bug report, instead. The entry form on GitHub takes care of a lot of the troubleshooting groundwork, so it really makes it a lot easier for me to reproduce bugs and fix them.
It offers some convenience features that makes it easy to add and replace field content without needing to whip out regular expressions. But yeah, as @suiyuan mentioned, there’s more info in the add-on description on AnkiWeb. I might add more of an intro to these support threads in the future, but currently short on time.
How does the “add after” and “add before” functionality work? I also keep getting the message “target undo op not found”, even when I try to use the replace function
Hey, I really appreciate your add-on — it works great and has been very useful.
I wanted to suggest a small modification: allowing users to select multiple local media files at once when using the attach action in Batch Edit.
I tested this only locally on my own setup (I did not distribute anything), and it worked well for my workflow.
Why this helps
The current single-file picker makes bulk image workflows slow (e.g., adding anatomy/histology/radiology image sets to existing notes). Multi-select would make batch editing much faster.
Minimal code-level idea
In dialog.py, replace single-file selection with QFileDialog.getOpenFileNames() and loop through selected files:
from aqt.qt import QFileDialog
import os
def choose_files(self):
key = "Images (*.jpg *.jpeg *.png *.webp)"
paths, _ = QFileDialog.getOpenFileNames(self, "Add Images", "", key)
if not paths:
return []
# optional: stable order
return sorted(paths, key=lambda p: os.path.basename(p).lower())
def insert_media(self):
media_files = self.choose_files()
if not media_files:
return
if not (editor := self._browser.editor):
return
html_fragments = []
for media_path in media_files:
filename = self._collection.media.add_file(media_path)
html = editor.fnameToLink(filename)
html = self._browser.editor._addMedia(media_path, canDelete=True)
if hasattr(self._collection.media, "escape_images"):
html = self._collection.media.escape_images(html, unescape=True)
else:
html = self._collection.media.escapeImages(html, unescape=True)
html_fragments.append(html)
current = self.text_edit.toPlainText()
new = "\n".join([*current.strip("\n").split("\n"), *html_fragments]) if current else "\n".join(html_fragments)
self.text_edit.setPlainText(new)
Thanks again for maintaining this add-on — this small change would be a big quality-of-life improvement for heavy batch-media workflows.