diff --git a/plugin/__init__.py b/plugin/__init__.py index c8a18ff..cfc3bf6 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -977,6 +977,8 @@ class AnkiConnect: aqt.dialogs.open(windowName, self.window()) addCards.setAndFocusNote(editor.note) + return ankiNote.id + elif note is not None: currentWindow = aqt.dialogs._dialogs['AddCards'][1] @@ -1011,10 +1013,14 @@ class AnkiConnect: else: openNewWindow() + return aqt.dialogs._dialogs['AddCards'][1].editor.note.id + else: addCards = aqt.dialogs.open('AddCards', self.window()) addCards.activateWindow() + return addCards.editor.note.id + @util.api() def guiReviewActive(self): return self.reviewer().card is not None and self.window().state == 'review'