The FMP protocol?
Clever idea. A bunch of free plugins and not free plugins let you perform script by calc name. BaseElements, SmartPill, the now dead zippScript
just a left field idea...
you can do a goto layout by calculation
you can create a script trigger on layout "load"...
yes, it's not elegant and it's possibly a waste of a layout PLUS you need to make sure layouts names aren't changed etc...
One of the things I used to setup in some solutions was a global field with a value list and a script trigger. The values in the list would correspond to a script that would goto layout by calc. This was used for navigation.
Keep in mind, there's nothing wrong with nested if statements, if they are all in the one script, it's easier to maintain 1 script than other tecniques that rely on layout names, script triggers etc...
but, I would say wimdecorte's solution would work best.
on Windows, you can do it with ActiveX.
script parameter is not supported yet...
(on Mac, may be able with AppleScript)