Is there way to mark card and flag card using JavaScript?

Using this
pycmd(‘ans’)
I can show answer, How can I mark card and flag card using such command?

Tags are for notes and in fact is built in as a tag. So to mark a note you would need to add “Marked” tag. Is there any reason you want to use JS and not by menus or shortcuts?

On AnkiDroid it’s possible by using the AnkiDroidJS interface; in AnkiDesktop it would be possible with add-ons, adding new bridge commands (invoked via pycmd); in AnkiMobile it’s not possible.

I hava implemented AnkiDroid JS API. And want it to be compatible with whole Anki ecosystem. So, in case of AnkiDroid calling function in JavaScript trigger AnkiDroid java implemention to mark card or flag card. I want it in Anki also.

1 Like

Yes, But I want to combine AnkiDroid JS API with Anki ecosystem.