Please explain the intended process more clearly.
Are you working with ExtendScript or CEP panel?
It I am not mistaken ExtendScript cannot listen to DOM while CEP can.
So, in case you work with ExtendScript, you will have to determine if layer is selected by clicking somewhere in your ScriptUI.
Script Events Manager would allow to run a Script at a certain event but I think I do not fully understand what the OP meant exactly.
It seems possible they simply meant a check in a Script that would determine to perform one thing if one Layer is selected and another if no Layer is selected.
Hi Tomas, I´m working in a CEP panel.
Thanks for your help.
Pfaffenbichler, thanks for the idea...I will try.