Anki add-on: Cut/Copy from editor to new note or add window (with scheduling)

You must read the section "Limitations, Quality" below. This add-on allows to copy or cut/extract selected/highlighted content from a note in the editor to a new note. The editor is shown in the "Add" window, the "Edit Current" window, and the bottom of the browser. You can send the content either to a different "Add" window or in the background straight to the database. The content of other fields (like "source", "page") can be copied. This allows to process a text in Anki. This add-on also has a scheduler component that was inspired by/adjusted from the Incremental Reading add-on so that cards from notes that have a special tag don't get increasing intervals when answering them. This add-on doesn't allow editing in the reviewer. To edit an underlying note you have to go the "Edit Current" window (shortcut is "e") from the reviewer. That's not elegant but this gives me the full editor so that I can use all add-ons for the editor. For long notes this add-no remembers the scroll position for a note in the "Edit Current" window. When you cut/copy some text and it contains a cloze "{{c" this is modifed in the source note to "{ {c" so that it no longer gets detected as a cloze in the source note. This means when you press "ctrl+shift+c" the next time it'll start with c1 again. I use a custom note type for texts to process and adjusted its Front template so that it only contains {{Front}}< script >pycmd("ans");< /script > (but no space after < and no space before >) so that I automatically go to the answer in the reviewer. I include a field in the Front Template so that it's not an empty card. # Motivation Sometimes I don't want to do process a text in one session. Storing the text in Anki and and being able to automatically copy over different fields has multiple advantages for me: This mostly saves time. Interleaving text processing with reviews makes the reviews more bearable. Sometimes I search for some info but forgot if I already have processed it - then I would have to search with the anki browser and in other software. When everything is in Anki I can find everything in Anki's browser. # Alternatives There's the add-on Incremental Reading . This works from the reviewer but has hardly any formatting options. There's also Supermemo's "incremental reading". But the Supermemo experience depends on many interlocking features. So this add-on is very different. E.g. my add-on just needs a very basic scheduler because I directly created finished notes/cards to review whereas in Supermemo's "incremental reading" you're encouraged to transform a source text to a question/answer pair in multiple small steps/reviews ("one memory, one action" worfklow) which depends on a sophisticated scheduler. For processing notes from within Anki there's also Searching, PDF Reading & Note-Taking in Add Dialog . For pdfs I prefer to convert them and copy them into Anki because that allows more editing. To quickly view the source file I use Open linked pdf, docx, epub, audio/video, etc. in external Program . To duplicate and then edit whole notes I use copy note contents to new Add window (from Browser, Reviewer, Add, EditCurrent) . # Limitations, Quality - general warning: Use this at your own risk. This is not a finished add-on but a pre-release: There should be some errors, the workflow can be improved, and the config needs to be moved from json to an easier-to-use gui dialog, there should be some preconfigured notetypes, etc. But in the current state this add-on should still be useful for some people. - when copying and marking the "extracted_color" is sometimes not applied. This happens when there are clozes in the selection - my postproscessing removes the formatting. Apart from this this very rarely happens to me. My workaround: In my add-on editor: apply font color, background color, custom class, custom style I added a shortcut to apply the same color. - sometimes when you extract parts of a table the extracted part is not shown properly in the new add window and Anki removes it. For me that's a theoretical problem because I never do such weird extracts. # other authors This add-on reuses/modifies from the original Anki, from glutanimate, and some scheduler related code from the add-on Incremental Reading . # Todo, Missing features many things like - fix that the cloze invalidation removes the background color. - add a shortcut to add "ignore" markup so that the add-on editor: apply font color, background color, custom class, custom style is no longer needed for this. This new command is aware of text that's already marked as extracted and doesn't change the color. So if I have extracted the relevant sentences from a paragraph I can ignore the rest by selecting the whole paragraph. At the moment the bgcolor for extracted is overwritten. - put new nid into source note: the js part for this are missing. - add a function "jump to extracted note" if a tag has a note-id in a property? - I store the source-nid for each extract. Maybe add a clickable tree view window? something inspired by supermemo's knowledge tree? - safe the original text before I do any modifications for reference. Hide it by default from browser searches? # Incompatible add-ons - glutanimate's "More answer buttons for new cards" because of this line (assert statement) . Change the line if self.card.type in (0, 1, 3): to if self.card.type in (0, 1, 3) and not self.cutcopy_isircard(): . - Customize Keyboard Shortcuts if you want to use "Ctrl+Alt+Shift+c" to create a cloze with a non-increasing number on an ir note. Change the line 19 from else: to else: if not (hasattr(self, "isIrNote_") and self.isIrNote_()): . The part "if not ..." must be in a new line and be indented by four spaces as well as all the "showInfo ..."" and "return" - for details see the docs folder in my github repo # Bugs, Feedback Please do not use reviews for bug reports or support requests. I don't get notified of your reviews, and properly troubleshooting an issue through them is nearly impossible (formatting is limited and I can't reply multiple times). If you find a bug let me know on github or in the official forum (use the button "contact author" in the upper right of this window). # required other add-ons - Opening the same window multiple time , - Keep model of add cards , - ReMemorize: Rescheduler with sibling and logging , # useful other add-ons - editor: apply font color, background color, custom class, custom style ,

GitHub repository: ijgnd/anki__editor_cutcopy_to_new_note