ScriptInterface:SetSelLayer(layer, multiSelect, allowDeselect)

Version added: before 9.5

Changes which layer is selected in the Layers window

ArgumentTypeDescriptionDefaultVer
layerMohoLayerNew selected layer< 9.5
multiSelectboolIf false, all previously selected layers will be deselected.false< 9.5
allowDeselectbooltrue< 9.5

Return type : none

You also have to call ScriptInterface:UpdateUI to update display of Layers window.
If the layer is in the closed group You can call ScriptInterface:ShowLayerInLayersPalette to open the group and show the layer. This action includes updating UI too.
String "SetSelLayer" is found in the following scripts:

Merge vector layers (by Danfield)

WP Import from Spine JSON (by wigglepixel)

Tagger (by Lukas)

Layer Finder (by Lukas)

MR Pose Tool (by eugenebabich)

See all...