Coder Social home page Coder Social logo

anki-copy-note's Introduction

Copy notes

Copy cards, either as new cards, or preserving intervals, ease, etc., from the original card.

To copy a note:

  1. Open the card browser
  2. Select at least one note.
  3. Go to Edit > Note Copy. The keyboard shortcut is configurable; the default is Ctrl+C.

The copy preserves fields, tags, and decks.

Warnings

Bug in previous version

Before the 26th of September 2019, there was a bug in this add-on. Because of this bug, if you shared and imported a deck containing either:

  • a note and a copy of this note
  • two notes originally copied from the same note then importing this deck will fail. Only one of the multiple notes will be imported; the other will be detected as copy by anki, even if they have quite different content.

This add-on does two things to correct this bug.

Correcting your collection

The first time you open a profile with this add-on installed, it'll check whether your collection contains the bug. In this case it'll ask whether you want to correct it or not. It won't check again the next time you open it; indeed, this bug should not appear again. (Unless you use an old version of this add-on on another computer which is synchronized with the same collection. But normally, in this case, it'll be corrected when you update this add-on on the other computer).

Correcting imports with this bug

Anki will try to detect when this bug exists in a deck you import. In this case, it'll correct it and tell you to tell to the deck's author to update this deck. Since this changes the importer, a part of anki which should not be touched by an add-on whose purpose is only to copy notes, you can deactivate it in the configuration.

Empty cards

There is a potential caveat, which should not occur often nor have real consequences. You should note that empty cards are not copied. If you don't know what this means, you probably don't need to worry about it.

Incompatibilites

This add-on is currently incompatible with:

Configuration

Using the add-on configuration, you can:

  • change the shortcut.
  • decide whether to keep the original creation time or set it to the current time.
  • decide whether to keep interval, due date, number of lapses, etc...

Relate card

Add-on 413416269 allows the user to relate notes, so that cards of related notes are buried as siblings during reviews (only on Anki desktop). Relations are created using tags. You can configure this add-on to automatically relate a note and its copy by ensuring that they share a tag. More precisely, if they already have a relation tag, then the same one will be used in the new copied note. Otherwise, a new tag will be added to both.

All Configuration Options

  • Copy log (Default = True): Whether to also copy the review log of the selected cards
  • Preserve creation time (Default = True): The original card and note's creation time are preserved. Otherwise, it is set to the time of the copy.
  • Preserve ease, due, interval... (Default = True): Preserve all information not related to creation date
  • Shortcut: copy (Default = Ctrl+C): set a custom keyboard shortcut
  • correct import (Default = True): Whether to correct bugs in imported decks created by an old version of this add-on. You should set it to False if it interferes with other add-ons; otherwise, keeping it set to True should be all right.
  • current tag prefix (Default = relation_): the prefix of the tag used to relate notes, as in Bury related notes add-on
  • relate copies (Default = True): Add a tag to relate the original note and its copy for the Bury related notes add-on
  • tag prefixes (Default = ['relation_']): if a copied note's tag contain a prefix in this list, no prefix will be added. As in the Bury related notes add-on
  • tag for copies (Default = 'copy'): A tag added to the new notes, copied from another note.

Links, licence and credits

Key Value
Copyright Arthur Milchior [email protected]
Based on Kealan Hobelmann's addon 396494452 (for anki 2.0)
Based on Anki code by Damien Elmes [email protected]
License GNU AGPL, version 3 or later; http
Source in https://github.com/Arthur-Milchior/anki-copy-note
Addon number 1566928056

anki-copy-note's People

Contributors

arthur-milchior avatar ijgnd avatar mattcarmody avatar snoyes avatar ukanuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

anki-copy-note's Issues

Do not copy marks when copying as new (optional)

When doing that based on marks, I may want to delete the original cards. But if I accidentally select all of the cards I copied, it will be hard to notice because both copies are still marked.

Error when copying card

With the newest Anki 2.1.32 I get an error as soon as I try to copy the card with Crtl+C in the browser.

Here is the error report:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.32 (dee7d45d) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-08-30 00:57:00

Caught exception:
Traceback (most recent call last):
File "C:\Users\p030\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 65, in
a.triggered.connect(lambda: copyNotes(browser.selectedNotes()))
File "C:\Users\p030\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 52, in copyNotes
copyNote(nid)
File "C:\Users\p030\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 83, in copyNote
note.flush()
File "anki\notes.py", line 68, in flush
File "anki\rsbackend_gen.py", line 344, in update_note
File "anki\rsbackend.py", line 265, in _run_command
anki.rsbackend.NotFoundError

Suggestion for option: Automatically create a card relation tag

Hi Arthur,

I have an idea regarding two of your add-ons. See how you find it; maybe you want to implement it in the future.

Copied notes tend to be similar to each other. Therefore, users might want them to be treated like siblings, i.e. buried.
Fortunately, you've already created the relation add-on for this. The relation process still requires manual steps. I imagine it could be automated with an option in "copy notes" to enable it, e.g. "add relation tag to copy and original".
As you are the creator of both add-ons, I assume you are the best for ensuring compatibility.
One issue that's come to my mind is that people can have differently named tags in their "Bury related notes" config.

Furthermore, this will bring your add-on "Bury related notes" to greater popularity because "Copy notes" is already widely used.

support Qt6

https://github.com/ankitects/anki/releases/tag/23.10beta6

The Qt5 compatibility code is now off by default, which may break some add-ons that haven't been updated to support Qt6 in the last 2 years. If you find any have broken, please report the issues to the add-on author, and start Anki after setting the env var ENABLE_QT5_COMPAT to 1 to temporarily restore the compatibility code.

error: name 'card' is not defined

Hi Arthur, your add-on is great, thanks for your hard work. Just today I install Anki and your add-on on another PC and when I try to copy a note there is a pop-up indicate that an error has occured:

Error 
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. 
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site. 
Debug info:
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
  File "C:\Users\ltvlu\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 60, in <lambda>
    a.triggered.connect(lambda : copyNotes(browser.selectedNotes()))
  File "C:\Users\ltvlu\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 49, in copyNotes
    copyNote(nid)
  File "C:\Users\ltvlu\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 68, in copyNote
    for card in cards: copyCard(card, note)
  File "C:\Users\ltvlu\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 84, in copyCard
    for data in mw.col.db.all("select * from revlog"): copyData(data)
  File "C:\Users\ltvlu\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 89, in copyData
    cid = card.id
<class 'NameError'>: name 'card' is not defined

copy log = review history?

Comprehension question: When the option "copy log" = true, is the add-on expected to copy the review history? For example, this:

2020-09-20 @ 10:28 Review 3 ⁨3.9⁩ years 2024-07-31 500% ⁨16.73⁩ seconds
2019-12-15 @ 07:29 Review 3 ⁨9.3⁩ months 2020-09-20 265% ⁨10.93⁩ seconds
2019-09-02 @ 09:00 Review 3 ⁨3.4⁩ months 2019-12-14 265% ⁨8.1⁩ seconds
2019-07-24 @ 10:27 Review 3 ⁨1.3⁩ months 2019-09-02 250% ⁨26.85⁩ seconds
2019-07-07 @ 21:06 Review 3 ⁨17⁩ days 2019-07-24 250% ⁨1⁩ minute
2019-06-28 @ 20:08 Review 3 ⁨8⁩ days 2019-07-06 250% ⁨12.31⁩ seconds
2019-06-23 @ 21:43 Review 3 ⁨2⁩ days 2019-06-25 250% ⁨4.77⁩ seconds
2019-06-22 @ 22:35 Learn 3 ⁨1⁩ day 2019-06-23 250% ⁨11.41⁩ seconds
2019-06-22 @ 21:29 Learn 3 ⁨10⁩ minutes na 250% ⁨9.96⁩ seconds
2019-05-10 @ 23:09 Review 3 ⁨23⁩ days 2019-06-02 130% ⁨3.91⁩ seconds
2019-04-23 @ 21:09 Review 3 ⁨16⁩ days 2019-05-09 130% ⁨9.7⁩ seconds
2019-04-11 @ 19:08 Review 3 ⁨12⁩ days 2019-04-23 130% ⁨7.53⁩ seconds
2019-04-03 @ 20:36 Review 3 ⁨8⁩ days 2019-04-11 130% ⁨12.51⁩ seconds
2019-03-26 @ 19:47 Review 3 ⁨6⁩ days 2019-04-01 130% ⁨31.18⁩ seconds
2019-03-23 @ 20:06 Relearn 3 ⁨3⁩ days 2019-03-26 130% ⁨1⁩ minute
2019-03-23 @ 19:54 Review 1 ⁨10⁩ minutes na 130% ⁨1.3⁩ seconds
2019-02-13 @ 19:00 Review 3 ⁨1.2⁩ months 2019-03-22 130% ⁨18.88⁩ seconds
2019-01-15 @ 20:50 Review 2 ⁨28⁩ days 2019-02-12 130% ⁨22.49⁩ seconds
2018-12-23 @ 16:38 Review 3 ⁨23⁩ days 2019-01-15 130% ⁨8.75⁩ seconds
2018-12-06 @ 11:30 Review 3 ⁨17⁩ days 2018-12-23 130% ⁨9.96⁩ seconds
2018-11-20 @ 15:03 Review 3 ⁨16⁩ days 2018-12-06 130% ⁨5.96⁩ seconds
2018-11-09 @ 14:26 Review 3 ⁨11⁩ days 2018-11-20 130% ⁨16.68⁩ seconds
2018-11-01 @ 13:47 Review 3 ⁨8⁩ days 2018-11-09 130% ⁨7.28⁩ seconds
2018-10-25 @ 13:19 Review 3 ⁨7⁩ days 2018-11-01 130% ⁨10.35⁩ seconds
2018-10-19 @ 10:28 Review 3 ⁨5⁩ days 2018-10-24 130% ⁨27.31⁩ seconds
2018-10-16 @ 14:41 Review 3 ⁨3⁩ days 2018-10-19 130% ⁨17.36⁩ seconds
2018-10-15 @ 12:26 Relearn 3 ⁨1⁩ day 2018-10-16 130% ⁨10.97⁩ seconds
2018-10-15 @ 12:13 Review 1 ⁨10⁩ minutes na 130% ⁨12.43⁩ seconds
2018-10-11 @ 12:10 Review 3 ⁨4⁩ days 2018-10-15 130% ⁨9.08⁩ seconds
2018-10-09 @ 19:07 Relearn 3 ⁨2⁩ days 2018-10-11 130% ⁨2.73⁩ seconds
2018-10-09 @ 18:52 Review 1 ⁨10⁩ minutes na 130% ⁨34.89⁩ seconds
2018-09-07 @ 16:31 Review 3 ⁨28⁩ days 2018-10-05 150% ⁨24.77⁩ seconds
2018-08-21 @ 23:39 Review 2 ⁨17⁩ days 2018-09-07 150% ⁨12.62⁩ seconds
2018-08-07 @ 14:00 Review 3 ⁨14⁩ days 2018-08-21 165% ⁨29.94⁩ seconds
2018-07-28 @ 22:48 Review 2 ⁨10⁩ days 2018-08-07 165% ⁨24.98⁩ seconds
2018-07-16 @ 17:06 Review 3 ⁨6⁩ days 2018-07-22 180% ⁨6.72⁩ seconds
2018-07-12 @ 16:45 Review 3 ⁨4⁩ days 2018-07-16 180% ⁨12.57⁩ seconds
2018-07-11 @ 14:01 Relearn 3 ⁨1⁩ day 2018-07-12 180% ⁨3.54⁩ seconds
2018-07-11 @ 13:52 Review 1 ⁨10⁩ minutes na 180% ⁨22.26⁩ seconds
2018-06-29 @ 07:31 Review 3 ⁨12⁩ days 2018-07-11 200% ⁨1⁩ minute
2018-06-23 @ 10:32 Review 3 ⁨6⁩ days 2018-06-29 200% ⁨4.66⁩ seconds
2018-06-19 @ 21:09 Review 2 ⁨4⁩ days 2018-06-23 200% ⁨1⁩ minute
2018-06-17 @ 10:53 Review 3 ⁨2⁩ days 2018-06-19 215% ⁨14.35⁩ seconds
2018-06-16 @ 08:23 Relearn 3 ⁨1⁩ day 2018-06-17 215% ⁨10.01⁩ seconds
2018-06-16 @ 08:13 Review 1 ⁨10⁩ minutes na 215% ⁨1⁩ minute
2018-06-13 @ 08:30 Review 2 ⁨3⁩ days 2018-06-16 235% ⁨12.07⁩ seconds
2018-06-04 @ 11:57 Learn 3 ⁨1⁩ day 2018-06-05 250% ⁨9.33⁩ seconds
2018-06-04 @ 11:34 Learn 3 ⁨10⁩ minutes na ⁨9.84⁩ seconds
2018-06-04 @ 11:33 Learn 1 ⁨1⁩ minute na ⁨8.52⁩ seconds
2018-06-04 @ 11:21 Learn 3 ⁨10⁩ minutes na ⁨7.81⁩ seconds

not working with Anki 2.1.47

I have used this add-on repeatedly for quite a while. It has been fantastic. It now doesn't function. I disabled all other add-ons then attempted to run Copy-Note but it still did not work. Seems to be very similar error to #34. See error details below:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.47 (dc156f34) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-09-07 05:29:45

Caught exception:
Traceback (most recent call last):
File "C:\Users...\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser.selectedNotes()))
File "C:\Users...\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 54, in copyNotes
copyNote(nid)
File "C:\Users...\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 87, in copyNote
copyCard(card, note)
File "C:\Users...\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 110, in copyCard
card.flush()
File "anki\cards.py", line 121, in flush
Exception: card.flush() expects an existing card

[Anki 23.10.1] Shortcut works where it shouldn't

The note is copied when the note editor is focused, e.g. when trying to copy tags.

I commented a.setShortcut(QKeySequence(getUserOption("Shortcut: copy", "Ctrl+C"))) out in copyNote.py in my local install to disable the shortcut.

Doesn't work on latest to date Anki

Hi, thanks for very useful addon!
Sad enough, didn't work for me.
Hope this would be of help to fix the issue:
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2021-11-21 12:00:59

Caught exception:
Traceback (most recent call last):
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser))
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 54, in copyNotes
copyNote(nid)
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 78, in copyNote
new_note, new_cards = add_note_with_id(note, nid if getUserOption("Preserve creation time", True) else None)
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\new_note_id.py", line 10, in add_note_with_id
mw.col.add_note(note, 1)
File "anki\collection.py", line 373, in add_note
File "anki_backend\generated.py", line 303, in add_note
File "anki_backend_init_.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨note has 6 fields, expected 15⁩

Cannot copy

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-02-17 09:03:06

Caught exception:
Traceback (most recent call last):
File "C:\Users\Holger\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 65, in
a.triggered.connect(lambda: copyNotes(browser.selectedNotes()))
File "C:\Users\Holger\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 52, in copyNotes
copyNote(nid)
File "C:\Users\Holger\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 83, in copyNote
note.flush()
File "anki\notes.py", line 68, in flush
File "anki\rsbackend_gen.py", line 344, in update_note
File "anki\rsbackend.py", line 267, in _run_command
anki.rsbackend.NotFoundError

Notes copied with ["Preserve ease, due, interval...": false] are not treated as new.

Hello! I have been using this addon since a while and I loved it. My main use is to copy the structure of an existing note and change its content to avoid create a new note from scratch. My addon config is:

"Copy log": false,

"Preserve creation time": false,

"Preserve ease, due, interval...": false,

"Shortcut: copy": "Ctrl+C",

"correct import": true,

"current tag prefix": "relation_",

"relate copies": false,

"tag for copies": "Copy",

"tag prefixes": [

    "relation_"

]

Today I was reviewing my cards and a new card appears with a strange interval, much greater that my 15m interval if I press "good" (my learning steps are [1 15 1440 4320]), so I look at the browser and the card information showed something like this. So the problem seems to be that the "due" date is not changed even though the "preserve ease, due,..." option is not enabled.

Also, I tried to "Reposition" this new copied card and I couldn't do, but if I press "Forget" the card, and then try to "Reposition" it, it works.
My Anki version is 2.1.42 btw.

Very bad crashes in Anki 2.1.38. Any chance for the update? Please man!

The extension does not work with Anki 2.1.38 and it can destroy the software. But I found that extension very useful in the past and I really hope you will consider updating the extension.

I want to reset all information in thousands of cards including the creation time, modification time and so on. It is possible by coping cards. You are my only hope Mr Developer.

Please help.

Project abandoned?

Hi,

I was wondering, it here will be an update yet, or if the project is abandondend. Unfortunately th addon doesn't work anymore and causes problems.

Thanks.

Tested ijgnd's new version and found no issues

Hi @ijgnd ,

apologies for the delay. I just tested your latest version of Arthur's copy notes addon and can only report success.

I cloned a collection from 3000 to ~ 14000 cards and had no issues: Not while doing reviews, not in preview mode and not after syncing, reviewing in AnkiWeb and syncing back. I also made Anki do a database check. I used Anki 2.1.47.

One question that came to my mind: You clone notes by creating a new nid with the old nid value +1. What if this nid is already taken? I assume you check beforehand? Otherwise I don't see much that could go wrong.

One other thing: Could you imagine working with me on this project? As I mentioned I would be willing to pay for it.

Not working in anki 23.10

Hello!
First of all, I really like this add-on and I would like to thank you.
My issue is that ANKI 23.10 version came out today and this addon does not work.
I would really appreciate it if you could update it.
Have a good day!

Error: Expected 15 fields found 16

This error appears when I right-click a note in the browser and click Note Copy, or when I press Cmd-C:

Traceback (most recent call last):
  File "~/Library/Application Support/Anki2/addons21/1566928056/copyNote.py", line 67, in <lambda>
    a.triggered.connect(lambda: copyNotes(browser))
  File "~/Library/Application Support/Anki2/addons21/1566928056/copyNote.py", line 54, in copyNotes
    copyNote(nid)
  File "~/Library/Application Support/Anki2/addons21/1566928056/copyNote.py", line 78, in copyNote
    new_note, new_cards = add_note_with_id(note, nid if getUserOption("Preserve creation time", True) else None)
  File "~/Library/Application Support/Anki2/addons21/1566928056/new_note_id.py", line 10, in add_note_with_id
    mw.col.add_note(note, 1)
  File "anki/collection.py", line 373, in add_note
  File "anki/_backend/generated.py", line 303, in add_note
  File "anki/_backend/__init__.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨note has 15 fields, expected 16⁩

Also, there is no Note Copy item in the Edit menu.

An error occurred.

I think I've been getting this error when I select Copy Note from the menu since the recent update. At least I assume it was the update since I haven't used it a lot, but I know when I first downloaded and tried it out a while back it it was working then, but not recently when I wanted to try to use it again.

An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=2

Caught exception:
File "C:\Users\Paul Schroeter\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 60, in
a.triggered.connect(lambda : copyNotes(browser.selectedNotes()))
File "C:\Users\Paul Schroeter\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 49, in copyNotes
copyNote(nid)
File "C:\Users\Paul Schroeter\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 68, in copyNote
for card in cards: copyCard(card, note)
File "C:\Users\Paul Schroeter\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 84, in copyCard
for data in mw.col.db.all("select * from revlog"): copyData(data)
File "C:\Users\Paul Schroeter\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 89, in copyData
cid = card.id
<class 'NameError'>: name 'card' is not defined

recently installed and the add-on doesnt seem to work

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-08-26 10:47:39

Caught exception:
Traceback (most recent call last):
File "C:\Users\Nick\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser.selectedNotes()))
File "C:\Users\Nick\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 54, in copyNotes
copyNote(nid)
File "C:\Users\Nick\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 87, in copyNote
copyCard(card, note)
File "C:\Users\Nick\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 110, in copyCard
card.flush()
File "anki\cards.py", line 121, in flush
Exception: card.flush() expects an existing card

time.py missing from repository

I downloaded the repo to see if I could tweak some things I'm interested in, but I noticed that time.py isn't committed to the git repo. It's in the anki addon download though, so maybe it was just missed in the most recent commit?
c87e2d6

Review History is not Copied Correctly

Title.

I copy a note which has 6 mature cards. In the copied version only one card has any review history, and all of said history is erroneously on that one Card. So that card has review history, but it does not sync up with the original card.

Anki version: 2.1.44

Due date is not reset

I fail a card; Rememorize reschedules its siblings; I copy the note as new… one of the cards (probably the one I failed, hence the one that was Relearning) is due today — "is:new is:due".

Anki 2.1.22, config.json:

{
  "Shortcut: copy":"Ctrl+C",
  "Preserve creation time" : false,
  "Preserve ease, due, interval...": false,
  "Copy log": false,
  "correct import": true,
  "current tag prefix": "relation-",
  "tag prefixes": ["relation-", "relation_"],
  "relate copies": false
}

Not working on Anki's latest 2.1.25 update :( Please update it

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.25 (898801eb) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-05-02 19:22:09

Caught exception:
Traceback (most recent call last):
File "C:\Users\USER\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 65, in
a.triggered.connect(lambda: copyNotes(browser.selectedNotes()))
File "C:\Users\USER\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 52, in copyNotes
copyNote(nid)
File "C:\Users\USER\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 81, in copyNote
copyCard(card, note)
File "C:\Users\USER\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 98, in copyCard
card.flush()
File "lib\site-packages\anki\cards.py", line 107, in flush
File "lib\site-packages\anki\rsbackend.py", line 507, in update_card
File "lib\site-packages\anki\rsbackend.py", line 257, in _run_command
anki.rsbackend.StringError: InvalidInput { info: "missing card" }

"Invalid configuration" error when trying to save options

I am using Anki 2.1.35 on macOS 10.15.6 (Catalina) and I just downloaded Anki Copy Note.

I want to copy some cards from a deck, and I don't care about copying the history (creation time, ease, etc), so I went to "Tools", then "Add-ons", then "Copy notes", then "Config". I changed the "Copy log", "Preserve creation time", and "Preserve ease, due, interval..." settings to false, clicked "OK", and saw a dialog box saying Invalid configuration: TypeError("argument of type 'NoneType' is not iterable") with a single button saying "OK".

I thought I messed something up in the config, so I clicked "Restore Defaults", then "OK", and saw the same error.

How can I be able to save my preferences for Copy Note?

Add-on fails to load (Anki 2.1.0beta36, Ubuntu 18.04)

Hi Arthur,

When I try to load Anki with this add-on, I get this error:

"An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading 'Copy notes':
Traceback (most recent call last):
File "/usr/share/anki/aqt/addons.py", line 57, in loadAddons
import(dir)
File "/home/will/.local/share/Anki2/addons21/1566928056/init.py", line 1, in
from . import copyNote, debug
File "/home/will/.local/share/Anki2/addons21/1566928056/copyNote.py", line 38, in
from .config import getUserOption
File "/home/will/.local/share/Anki2/addons21/1566928056/config.py", line 54, in
mw.addonManager.setConfigUpdatedAction(name,update)
AttributeError: 'AddonManager' object has no attribute 'setConfigUpdatedAction'"

I'm running Anki Version 2.1.0beta36 (Qt 5.9.5 PyQt 5.10.1) on Ubuntu 18.04.3 LTS.

Thanks!
Will

Version 2.1.49 New Issue - Cannot copy notes with more than 10 fields

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-11-26 12:49:28

Caught exception:
Traceback (most recent call last):
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser))
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 54, in copyNotes
copyNote(nid)
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 78, in copyNote
new_note, new_cards = add_note_with_id(note, nid if getUserOption("Preserve creation time", True) else None)
File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\1566928056\new_note_id.py", line 10, in add_note_with_id
mw.col.add_note(note, 1)
File "anki\collection.py", line 373, in add_note
File "anki_backend\generated.py", line 303, in add_note
File "anki_backend_init_.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨note has 20 fields, expected 10

Just work when the note has 2 fields(?)

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.47 (dc156f34) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2021-09-21 12:39:51

Caught exception:
Traceback (most recent call last):
File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser))
File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 54, in copyNotes
copyNote(nid)
File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 78, in copyNote
new_note, new_cards = add_note_with_id(note, nid if getUserOption("Preserve creation time", True) else None)
File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1566928056\new_note_id.py", line 10, in add_note_with_id
mw.col.add_note(note, 1)
File "anki\collection.py", line 373, in add_note
File "anki_backend\generated.py", line 303, in add_note
File "anki_backend_init_.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨note has 59 fields, expected 2⁩

@ijgnd

error: list index out of range

I tried to copy a note. The following error appeared. When syncing, anki says that there are cards which have no note. I can delete the cards with "check database".

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.15 (6661ba8a) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
File "C:\Users\user\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 57, in
a.triggered.connect(lambda : copyNotes(browser.selectedNotes()))
File "C:\Users\Jo\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 46, in copyNotes
copyNote(nid)
File "C:\Users\Jo\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 76, in copyNote
card.flush()
File "", line 2, in flush
File "anki\hooks.py", line 74, in decorator_wrapper
File "anki\hooks.py", line 66, in repl
File "C:\Users\Jo\AppData\Roaming\Anki2\addons21\865767531_init_.py", line 180, in update_caches_for_card
self.add_cards_to_caches(s.col, [s.id], update=True)
File "C:\Users\Jo\AppData\Roaming\Anki2\addons21\865767531_init_.py", line 100, in add_cards_to_caches
qa = self.get_card_qa(collection, card_id)
File "C:\Users\Jo\AppData\Roaming\Anki2\addons21\865767531_init_.py", line 72, in get_card_qa
return collection.renderQA([card_id])[0]
<class 'IndexError'>: list index out of range

I need both "Copy as New" and "Copy Full".

I use "Copy as New" to reset notes completely, and also "Copy Full" now to split notes. I guess it would be easy for me to just make a second copy of the add-on with small changes, but still.

Cards containing more than 11 fileds won't be copied.

It seems that the addon cannot copy cards which contains more than 11 fields.
Here's the error report.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.48 (fb07bad3) Python 3.8.1 Qt 5.15.1 PyQt 5.15.1
Platform: Linux
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-10-13 13:44:00
Add-ons possibly involved: ⁨Copy notes⁩

Caught exception:
Traceback (most recent call last):
File "/home/[userName]/.local/share/Anki2/addons21/1566928056/copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser))
File "/home/[userName]/.local/share/Anki2/addons21/1566928056/copyNote.py", line 54, in copyNotes
copyNote(nid)
File "/home/[userName]/.local/share/Anki2/addons21/1566928056/copyNote.py", line 78, in copyNote
new_note, new_cards = add_note_with_id(note, nid if getUserOption("Preserve creation time", True) else None)
File "/home/[userName]/.local/share/Anki2/addons21/1566928056/new_note_id.py", line 10, in add_note_with_id
mw.col.add_note(note, 1)
File "anki/collection.py", line 373, in add_note
File "anki/_backend/generated.py", line 303, in add_note
File "anki/_backend/init.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨note has 13 fields, expected 11⁩

The creation time is not preserved in the copied card when "Preserve creation time" is set to true.

I use anki version 2.1.44.
The "Preserve creation time" is set to true. However the date of creation of the new card (the copy) is the date when the copy was made, not the date of creation of the original card, which is the expected behaviour.

Config:
{
"Copy log": true,
"Preserve creation time": true,
"Preserve ease, due, interval...": true,
"Shortcut: copy": "Ctrl+C",
"correct import": true,
"current tag prefix": "relation_",
"relate copies": false,
"tag for copies": "Copy",
"tag prefixes": [
"relation_"
]
}

Feature Request

It would be awesome to add a tag to copied notes to make sorting them easier

Error message in Anki 2.1.46

When I try to copy a note, this message appears:

Caught exception:
Traceback (most recent call last):
File "C:\Users\…\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 67, in
a.triggered.connect(lambda: copyNotes(browser.selectedNotes()))
File "C:\Users\…\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 54, in copyNotes
copyNote(nid)
File "C:\Users\…\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 87, in copyNote
copyCard(card, note)
File "C:\Users\…\AppData\Roaming\Anki2\addons21\1566928056\copyNote.py", line 110, in copyCard
card.flush()
File "anki\cards.py", line 121, in flush
Exception: card.flush() expects an existing card

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.