Select object in highlighted Layer?

I do want to create a macro or script to select and isolate all the objects that are in selected layers, instead of Right-clicking on the layer list and pressing the Select Objects from the list of actions and typing isolate afterwards.

I do found this script: Select Objects on Layer that almost does what I need, excepting that it is asking me to type a layer name.

It is possible to add a small modification to this script so, instead to ask-me for a layer name, to pick-up automatically the names of selected layers for me and select all the objects from that layers automatically?

Maybe:

_SelLayer _Pause _Isolate

?

This command it is popping-up a Layer list asking me which ones I do want to select.

I do already have the selected layers in the Layers tab and I do want to replace the Right-click/Select Objects/Isolate commands with a more automatic way of doing this.

It is more convenient to do all this automatically from the Layer panel as I do manipulate a lot the layers.