Skip to main content
Home About Privacy Contact

Anki JS API addon for getting decks and cards info like AnkiDroid JS API

AnkiDroid JavaScript API allow deck developer to add functionality to cards that can call native functions defined in AnkiDroid. This can be used to design whole new layout for buttons, cards info, top bar card counts, mark, flag etc. But Anki Desktop there are no official support like this JS API. 
So, this is Anki addon for supporting the AnkiDroid-JS-API.


Usages
To know more about the options view AnkiDroid-JS-API

New Count
pycmd("AnkiJS.ankiGetNewCardCount()", (ret) => { console.log(ret); });

Learn Count
pycmd("AnkiJS.ankiGetLrnCardCount()", (ret) => { console.log(ret); });

Review Count
pycmd("AnkiJS.ankiGetRevCardCount()", (ret) => { console.log(ret); });

Mark
pycmd("AnkiJS.ankiGetCardMark()", (ret) => { console.log(ret); });

Flag
pycmd("AnkiJS.ankiGetCardFlag()", (ret) => { console.log(ret); });

Card Id
pycmd("AnkiJS.ankiGetCardId()", (ret) => { console.log(ret); });

Note Id
pycmd("AnkiJS.ankiGetCardNid()", (ret) => { console.log(ret); });

Deck Id
pycmd("AnkiJS.ankiGetCardDid()", (ret) => { console.log(ret); });

Last modified time of card
pycmd("AnkiJS.ankiGetCardMod()", (ret) => { console.log(ret); });

Type
pycmd("AnkiJS.ankiGetCardType()", (ret) => { console.log(ret); });

Queue
pycmd("AnkiJS.ankiGetCardQueue()", (ret) => { console.log(ret); });

Left
pycmd("AnkiJS.ankiGetCardLeft()", (ret) => { console.log(ret); });

Due
pycmd("AnkiJS.ankiGetCardDue()", (ret) => { console.log(ret); });

Interval
pycmd("AnkiJS.ankiGetCardInterval()", (ret) => { console.log(ret); });

Factor
pycmd("AnkiJS.ankiGetCardFactor()", (ret) => { console.log(ret); });

Reps
pycmd("AnkiJS.ankiGetCardReps()", (ret) => { console.log(ret); });

Lapses
pycmd("AnkiJS.ankiGetCardLapses()", (ret) => { console.log(ret); });

Original Due
pycmd("AnkiJS.ankiGetCardODue()", (ret) => { console.log(ret); });

Deck ID of home deck if filtered
pycmd("AnkiJS.ankiGetCardODid()", (ret) => { console.log(ret); });

Next Time 1
pycmd("AnkiJS.ankiGetNextTime1()", (ret) => { console.log(ret); });

Next Time 2
pycmd("AnkiJS.ankiGetNextTime2()", (ret) => { console.log(ret); });

Next Time 3
pycmd("AnkiJS.ankiGetNextTime3()", (ret) => { console.log(ret); });

Next Time 4
pycmd("AnkiJS.ankiGetNextTime4()", (ret) => { console.log(ret); });

Image

Comments

Popular posts from this blog

Import CSV file and generate Anki Deck on Android phone using Pydroid 3

When we have to create anki deck, then Anki Desktop needed. But in this post learn to create anki deck by importing csv, tsv or .txt file on Android. Steps: 1. Install Pydroid 3 from Play Store.  2. Install genanki python library inside Pydroid using pip. 3. Then download Anki Deck Export Tkinter   4. Run this script  5. Select file and fields separated by (tab, comma) 6. Click Import 7. Enter file name, title name, model name. 8. Enter name of fields to be mapped This generate default CSS for exporting deck. The css can be modified inside AnkiDroid app.  Note: It will run on Desktop also. View Code main.py Demo

Sentence Adder Anki Addon: Add sentence in Anki editor in one click

Add sentences to Anki editor window in one click with batch adder option Select a word in edit field and click add button to add sentences to that fields matching the words. Also create/add sentences for any languages. The sentences database created using tatoeba language tsv files. Download language tsv file from tatoeba . Install Download addon from AnkiWeb  Sentence Adder Anki Addon Download from GitHub release page  Sentence Adder Anki Addon Features Create new language database Add random sentence in one click View list of all sentences matching the selected word Change language (Require restart of Anki to apply changes) Change color of sentences Batch sentences adder Sentences containing spaces Usage Install 1. Install Addon from AnkiWeb Anki -> Tools -> Add-ons -> Get Add-ons... Paste the code 1682655437 and install. 2. Restart Anki and open the Addon to add new languages. 3. Download language of ch...