CEP extension development - How to detect user selection changes in active project
I'm developing an After Effects extension using adobe CEP, and as far as I've found so far, there is no built-in way of detecting changes in user selection i.e. - listening to events like user has selected a different composition(s)/layer(s).
Beacause of that, I've created a simple workaround where I set an interval in the CEP side, and each 200ms I issue a call to ExtendScript to fetch the current user selection(by "selection" I mean compositions/layers - if any where selected), and update the panel UI accordingly.
The solution above works nicely for fairly smaller projects, but for projects that contains large amount of compositions and layers, it just crashes After Effects completely.
Is there any official/recommended way of acheiving that goal?
