Hello,
I would like to create a button which, when clicked, reveals the first character of the current cloze, e.g.:
If my note is: “{{c1::This}} {{c2::is}} {{c3::an}} {{c4::example}}” and card n°4 is currently displayed, clicking the button would show the letter “E”
I have no clue, though, on how to target the current cloze only.
Is it possible? Any ideas?
Very nice! It seems to work on Anki 2.1.49 too. Thank you
One last thing: do you have an idea on how to make the code work for all the clozes, if there are 2+ clozes with the same number? Right now it works on the first one only.
e.g. if note is “{{c1::This}} {{c1::is}} {{c2::an example}}” and card n°1 is now displayed, if I click on the button, the “T” will be displayed but not the “i”
(I’m using a modified version of your code, which, instead of displaying just the first letter, displays each letter sequentially; these are the lines I added/modified:
var nextChar = 0
getCurrentClozedText(currentClozeNumber).trim()[0, nextChar++]; )