noteTypes.replaceText
noteTypes_replaceTextReplace literal text in selected Anki note types or all note types, targeting question, answer, and/or CSS fields. Use one selector and get changed type counts, not occurrence counts.
Instructions
Replace literal text in explicit note types or all note types.
Exactly one selector: noteTypes or allNoteTypes=true. Count changed types, not occurrences.
Anki-Connect method noteTypes.replaceText. Scope: collection. Effect: write. Completion: completed. Undo: grouped.
Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, staleSession.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| find | Yes | Literal text to find (not a regex). | |
| replace | Yes | Replacement text (may be empty). | |
| session | No | Optional. Collection session ID: the `session` field returned by `collection_get`. Usually omit it — the server then uses the session current at the time of the call. Pass it to make the call fail with `staleSession` instead of acting on a different profile/collection than the one your IDs, cursors and tokens came from. | |
| targets | No | Where to replace: any of question, answer, css. Default all three. | |
| noteTypes | No | Note types to change, each exactly one of {"id": "<noteTypeId>"} or {"name": "<note type name, e.g. Basic>"}. Give either this or `allNoteTypes: true`. | |
| allNoteTypes | No | Set true (instead of `noteTypes`) to change all note types. |