Autocopy for Anki

This add-on can automatically copy text from a card to the clipboard.
- When the card is selected in Browser.
- When Reviewer shows the card's front side.
- When Reviewer shows the card's answer side.
- When Editor loads a note, if enabled in the options.
Use cases:
The add-on is intended to assist in editing large amounts of cards.
- When editing premade or unfinished Anki decks.
- When using
Yomichan's clipboard monitor feature to add definitions to a deck of subs2srs cards.
Installation
Install from AnkiWeb, or manually with git:
git clone 'https://github.com/Ajatt-Tools/autocopy.git'
ln -sr autocopy/autocopy ~/.local/share/Anki2/addons21/autocopy
Configuration
- To configure the add-on, select "AJT" > "Autocopy Options...".
- To toggle autocopy on and off, select "AJT" > "Activate Autocopy".

Usage
- Configure what fields you want to copy.
- Configure when to copy the fields.
- The content of the fields will be sent to the clipboard under the set conditions.
Copied text preserves HTML line breaks and paragraph boundaries.
Configured fields are separated by newlines in their configured order.
Formatting, images, and Anki [sound:...] references are omitted from the plain text.
If no non-whitespace text remains, the clipboard is left unchanged.
Development
Run tests with hatch test or run the complete suite with coverage using hatch test --cover.
For a focused run, use hatch test tests/test_main.py.
Check formatting without changing files with hatch check fmt.
Apply formatting fixes with hatch check fmt --fix.
Lint Python code with hatch check code and check shell scripts with shellcheck scripts/*.sh.