Passing multiple arguments to a :post_script

30 views
Skip to first unread message

Jim Polk

unread,
Sep 6, 2012, 5:46:08 PM9/6/12
to rfmcom...@googlegroups.com

I see in layout.rb, some documentation that reads:

  # ==Passing Parameters to a Script
  #
  # If you want to pass a parameter to the script, use the options above, but supply an array value
  # instead of a single string. For example:
  #
  #   myLayout.find({"First Name" => "Bill"}, :post_script => ["Remove Duplicates", 10])
  #
  # This sample runs the script called "Remove Duplicates" and passes it the value +10+ as its
  # script parameter.

But what if you need to pass more than one argument?...Can Rfm handle that?...and if so, what would the syntax look like?

Like so?

myLayout.find({"First Name" => "Bill"}, :post_script => ["MyCustomScript", "this", "that","etc"] )

or

myLayout.find({"First Name" => "Bill"}, :post_script => ["MyCustomScript", ["this", "that","etc"]  ] )

or

args = [ "this", "that", "etc"]
myLayout.find({"First Name" => "Bill"}, :post_script => ["MyCustomScript",  args]  )

or perhaps some other syntax?

Almost all the data I need to pass is textual, and not numerical....

Thanks!!


wbr

unread,
Feb 16, 2013, 3:46:28 AM2/16/13
to rfmcom...@googlegroups.com
Unfortunately, Filemaker scripts can only accept a single parameter. If you want to pass multiple parameters, be it thru the XML interface or via Filemaker client, you must roll your own by passing a single string of parameters separated by some character. Then parse the string on the Filemaker side.


Reply all
Reply to author
Forward
0 new messages