I want to expose all UI functions through the JS API

It would be amazing if all UI functions can be accessable through the JS API. By exposing all, a complete UI overhaul e.g. for better accessibility (bigger buttons) would be possible. Many UI functions are exposed, e. g. starting the tag chooser, burying, setting due date et al.; others are not, e.g. entering Edit-Mode.

I will implement this if someone helps me a little. I am able to modify the code of the JS API, but AnkiDroid’s other code is just too complex for me.

I need help with this:

  1. How can I programmatically “press” the Edit button?
  2. How do I programmatically add a tag to the current note?
  3. It would be amazing to be able to change a field of the current card.
  4. Changing the deck and also setting the due date.
  5. Setting that a card should be displayed again in one hour or two hours, even if these times are not present on the displayed answer buttons.

Sorry for using funny terms, I am not versed in Anki’s terminology, I am grateful for any corrections.

Not relevant any more / wrong , see comments below:

  • I am also very interested in programmatically “answering” (like tapping 1h, 1d, etc.) a card and at the same time setting the due date to a different date than the answer button has. The current API functions cannot be called after one another because the first one will continue to the next card. Also changing the deck at the same time would be very helpful.~~
1 Like

Why would you want to answer the card but then reschedule it? Also Anki comes with it’s own scheduler. You don’t need to manually schedule something to two/three hours. Why take up the job that Anki is already doing for you.

(Also, you actually tag notes and not cards, minor correction xD)

Hi Sorata! Thank you for answering.

Also Anki comes with it’s own scheduler. You don’t need to manually schedule

I want much more control over when the cards are due again than the normal four buttons offer.
I made myself a menu with all the buttons in the pic. Like this it was possible with the current JS API.


image

Why would you want to answer the card but then reschedule it?
Because most of my buttons use reschedule, which works mostly fine, except that reschedules are not logged in the answer log. I would like to have it logged.

What do you mean answer log? It appears in the card info as a ‘0’ (1 for Again, 2 for Hard, 3 for Good, 4 for Easy)

Oh… it does… thank you! I will cross that out then :slight_smile:

I noticed that this discussion is in the wrong category. I copied it over to the right place: I want to expose all UI functions through the JS API. Need advice