It looks like tv_LayerInfo is the correct command:
However, parsing the result displays the Selection value as "OFF", not as a value of 0 or 1... and the value is always "OFF" no matter if the layer is selected or not. Can anyone confirm?tv_LayerInfo
tv_LayerInfo id
Gives 10 informations about the layer with identifier id. This information includes the display, position, opacity, name, type, start, end, pre-lighttable, post-lighttable and selection. The display value indicates if the layer is displayed (ON) or masked (OFF). The position value is the position of the layer in the list (the first layer is at position 0). The opacity value indicates the global opacity of the layer (between 0 and 100). The name value contains the layer name. The type value indicates if the layer is an animation layer (SEQUENCE), an image layer (IMAGE) or a read only layer (VIDEO). The start and end values defined the first and last frame numbers on the global time-line. The pre and post lighttable values indicates if the light tablet is inactive (0) or active (non-zero value, max 7) for this layer. The selection value is 0 if the layer is not selected or 1 if selected.
Sven