Guy Weymouth Posted December 22, 2004 Posted December 22, 2004 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
Ender Posted December 22, 2004 Posted December 22, 2004 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.
Ender Posted December 22, 2004 Posted December 22, 2004 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)") ]
Søren Dyhr Posted December 22, 2004 Posted December 22, 2004 Shawn has done this custom function: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=80 --sd
Newbies furbies Posted January 8, 2005 Newbies Posted January 8, 2005 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...
Recommended Posts
This topic is 7258 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now