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.