I want to have a single print button to print any layout without having to have a separate script
Could you not create a button, right-click on button to go into Button Setup and simply Print?
I'd like to create a global variable which changes its value to the name of the current layout whenever that layout is opened
Create a script as you suggest that triggers OnLayoutEnter that includes:
Set Variable [$$VariableName ; Get ( LayoutName)]
Name : $$VariableName
Value: Get (LayoutName)
I have a separate print and screen layout for each report. The names of the print layouts are the same as the name of the screen layouts but with "-Print" appended.
All I ended up doing is this:
Go to Layout [Get (layoutName) &"-Print"]
and it seems to do just what I wanted.
Is there a list of all the functions somewhere (like layoutName)? Things you could put in a Get command, for example?