Hi there! I wrote an article about creating your own dynamic buttons for side toolbar which was introduced in Komodo IDE X. In this tutorial you can learn how to create a very simple button with some functionality and how to make it appear only when there’s a project opened (which means how to create statements when the button should work).
You can read it there:
https://blog.defman.me/dynamic-buttons-in-komodo/