December 22, 200421 yr I am currently using the one script to go to certain layouts and changing the script parameter of each button to the name of the layout to go to. The script then gets the script parameter to determine which layout to go to. Easy. What if I want to have two script parameters. One holds the layout name to jump to and another determines whether a new window is opened when going to that layout. So, ScriptParameter = a = staff ; b = new_window and then in the script: If b = "new_window" go to layout "a" in a new window else go to layout "a" end if How can I do that? Widey
December 22, 200421 yr Try putting different values on separate lines: Script parameter="staffnew_window" Script: If [ position(middlevalues(Get(ScriptParameter);2;1);"new_window";0;1) ] New Window [] End If Go to layout [ Name by calculation: Let(value = MiddleValues(Get(ScriptParameter);1;1); Left(value; Length(value)-1)) ] You could use other methods for separating values, but I like line returns.
December 22, 200421 yr To use named parameters, like you were trying, adjust your syntax like this: Script parameter= "a="staff";b="new_window"" Script: If [ Evaluate("Let ( [" & Get(ScriptParameter) & "]; b)") = "new_window" ] New Window[] End If Go to layout [ Name by calculation: Evaluate("Let ( [" & Get(ScriptParameter) & "]; a)") ]
December 22, 200421 yr Shawn has done this custom function: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=80 --sd
January 8, 200521 yr Newbies Try putting different values on separate lines: Script parameter="staffnew_window" Script: If [ position(middlevalues(Get(ScriptParameter);2;1);"new_window";0;1) ] New Window [] End If Go to layout [ Name by calculation: Let(value = MiddleValues(Get(ScriptParameter);1;1); Left(value; Length(value)-1)) ] You could use other methods for separating values, but I like line returns. To add to the code above, how would I test if a layout is already open/visible in another window ? Pete...
Create an account or sign in to comment