triggering show answer button by code
Hi friends;
Is there any way to trigger the "show answer" button by code?
Comments are closed, but you can start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by ijg on 08 Aug, 2019 03:54 PM
by which code? python or js? for js maybe try
pycmd("ans");
(check the source of reviewer.py2 Posted by daniham on 08 Aug, 2019 04:00 PM
Hi;
thank you for the reply;
What I meant was JS. I know a little bit of JS, but I don't know Python.
Is there any way to do it in JS?
tanks
3 Posted by daniham on 08 Aug, 2019 04:03 PM
I assume it would be easier to do it in Python. right?
4 Posted by ijg on 08 Aug, 2019 04:07 PM
it's what I wrote: for javascript maybe try
pycmd("ans");
(check the source of reviewer.pythe main window contents, the reviewer and the editor (in the add window, bottom of the browser) are html sites with html buttons. So you can use (and sometimes need) javascript. This javascript communicates with python/the main anki program using the
pycmd
command.With python it should be easier but with javascript it should also work.
5 Posted by ijg on 08 Aug, 2019 04:08 PM
if you use anki 2.1:
https://apps.ankiweb.net/docs/addons.html#webview-changes
6 Posted by daniham on 08 Aug, 2019 04:13 PM
Thanks, man;
I'll give it a try and see if it works.
my problem with Anki 2.1 is that I use so many add-ons that haven't been updated yet for this version. otherwise, I would use the new version gladly.
Thank you for your time and quick reply
best
7 Posted by ijg on 08 Aug, 2019 04:50 PM
in 2.0 it's not pycmd but something like
py.link("ans")
. I have stopped using 2.0 so I can't say.Maybe useful: https://www.reddit.com/r/Anki/comments/c88vww/alternatives_for_21_f...
8 Posted by daniham on 08 Aug, 2019 04:51 PM
Thank you for the update man.
I appreciate it!