I put it in Anki, but nothing happened. I tried the simple add on example
and put it in Anki and saw no effect after restarting Anki. I think there
is something wrong with getting the ankirspy package.
That hook is coming in 2.1.20, which is not yet in beta testing. I added a note on the page about it, but you may have been looking at the page before the note was added, so I'm sorry if there was confusion. The examples on the rest of the page with the exception of the new hooks section should work however.
Thanks so much! I've got the test function to run now. I'm hoping to export
note ids into a spreadsheet every time you hit synchronize or close. Where
can I link my function to the synchronize action? I'm having trouble
finding that on github. Any help would be appreciated. Anki is awesome!
Using the just-released 2.1.20beta1, you can see all the available hooks in hooks.py and gui_hooks.py. The collection unloading hook may be what you want. I'm afraid I can't offer support for add-on writing, but if you get stuck, the code of other add-ons can be a useful way to learn how things are done.