Hi,
Sorry for the newbie questions, but I’ve searched the forum and the sparse documentation for a long time and haven’t found any answers.
I’m trying to create an add-on for editing card by adding media created by some text and external programs (this part is ok). I figured out how to add a button to the edit toolbar with aqt.gui_hooks.editor_did_init_buttons.append
, but I didn’t find out how to get the selected text and replace it with something by clicking on the button I created. I couldn’t find a way to get selectedText()
with the editor
parameter given to my callback function or something else. Then, there is the problem with replacing the selected text with what my program has generated.
I don’t understand how I could use JavaScript for that purpose (if it’s possible only with python, I would prefer it, because it feels messy to me to mix two paradigms for the same use).
Thank you!
Luca