I have to apologize to you, Kuba. It was nonsense to say that your solution is not better than mine.
In fact, my solution is wrong and yours normally works. Thanks a lot. I had tried my solution with a stylesheet from a subdirectory Wolfram\ProgrammingLabDefault.nb only.
We still have a problem, when we add any own additional StyleDefinitions. As an example:
setPS1[] := SetOptions[
EvaluationNotebook[],
StyleDefinitions -> Notebook[
{
(* Style Environment Names with correct Magnifications *)
Cell[StyleData[All, "Printout"], Magnification -> 1.0],
Cell[StyleData[All, "Working"] , Magnification -> 1.0 ]
}
]
]
If we execute that once, the findStyleSheet-function will no longer work, since CurrentValue[thisNb,StyleDefinitions]
does no longer give the StyleDefinitions for the stylesheet name, but that own StyleDefinitions prepended.
I think I can easily solve that circumstance, but I have no time at the moment.