I can see multiple ways of doing that.
One would be to have a a control composition;
In this composition you drop all your finals composition.
Add a Null and in there the Expression Control “Control Layer”
Now in your expression use that Control Layer to point your expression to the correct composition.
Your code for your scale would look like
C = comp("Control Comp").layer("Null 1").effect("Layer Control")("Layer").name;
s = comp(C).layer("The layer on which the slider is on").effect("Slider Control")("Slider");
[s, s]
You can even user your Control Composition as Final render if you add this code to the opacity of each Finals Comp in the Control Composition, to only render the composition you want.
C = thisComp.layer("Null 1").effect("Layer Control")("Layer").name;
If (C == thisLayer.name) 100 else 0
The only problem with this method is that you cannot render queue multiple composition at the same time. You will have to add to Encoder one by one, or it will only take the latest value of the control layer and use that to all your renders.
The other method which I use more frequently would be to add a text layer as guide layer in your footage comp. And use the text in there to name the comp you want to use to control it. Then duplicate that footage comp as many time as necessary and change the text in each comp to match the name of the final composition it is nested in.
This time the code for scale would look like
C = thisComp.layer("The Text layer").text.sourceText.value;
s = comp(C).layer("The layer on which the slider is on").effect("Slider Control")("Slider");
[s,s]
With this method depending on how many final comps you have it takes time to setup, but you won’t have that render queue problem you have in the first method.
It’s quite hard trying to explain the method I use. I hope you understood and that it can help.