↧
some notes on how to do this (presumes within an addon, but easy to adapt for an app):