Get list of selected objects on specific layer How to find which objects are selected on a given layer?

bpy.context.scene.selected_objects shows objects only on visible layer(s). After switching to another layer, the list of selected objects is gone.

&gt;&gt;&gt; bpy.context.scene.layers[0] = False
&gt;&gt;&gt; bpy.context.scene.layers[10] = True
&gt;&gt;&gt; bpy.context.scene.object
bpy.data.objects['Cube']

&gt;&gt;&gt; bpy.context.scene.selected_objects
[]

&gt;&gt;&gt; bpy.context.scene.layers[0] = True
&gt;&gt;&gt; bpy.context.scene.selected_objects
[bpy.data.objects['Cube']]
Returning only the selected objects on a layer simply requires checking the object's select property at the same time as checking which layer it is on. 

To extend the example on Get the list of objects on a layer in python:

import bpy

layerIndex = 0  #Chosen layer
objects = bpy.context.scene.objects

selectedObjects = [ob for ob in objects if ob.layers[layerIndex] and ob.select]