
Java Virtual Machine (JVM) version 1.4.2 or later. Here is what the FileMaker script step might look like: Likewise, the script returns the contents of the file, but we can also access the modification date using the SMGetVariable function. We can set the path variable using the SMSetVariable function. The path argument is not set in the script, so we must provide that from FileMaker. This instantiates a File object, queries it for the modification date, and returns its contents. The following illustrates the various ways of working with the ScriptMaster plugin.
#360works email plugin code#
jar is stored in FileMaker, deploying new versions of the java code to the FileMaker clients is as easy as updating a single container field. jar, and distribute it with your FileMaker solution! And since the. You could also easily write your own java code, package it as a. This means you can bundle in things like the Jakarta Commons packages or JavaMail. jar file, and any scripts you execute will have access to the classes in that. If there's some lib you need to use that isn't in the JDK, you can load it into the ScriptMaster classpath by using the SMLoadJar function. If an error occurs during evaluation, the field is left as is. merge(template) Processes some text with merge fields embedded, replacing the merge fields with their evaluated values. performScript(fileName, scriptName ) Performs a FileMaker script in the current file, passing in the optional paramString as a parameter. The fmcalculation parameter can be any valid FileMaker calculation string. This is accomplished using the reserved fmpro object.Įvery Groovy script which is executed will have an fmpro variable set to an instance of an FMPro object, which has two important methods: evaluate(fmcalculation) Evaluates the supplied FileMaker calculation text, returning the result as a String. In addition to setting variables prior to script execution, you can access the FileMaker calculation engine directly from within your Groovy script. This is a handy way to get data from FileMaker into your custom scripts.Īfter a ScriptMaster script is evaluated using the EvaluateGroovy function, you can access any of the named variables which were set during execution using the SMGetVariable function. You can set variables prior to executing a script using the SMSetVariable function. (such as closures) to the standard java API, some of which can be big timesavers.Ĭonsult the FileMaker demo file and the Groovy website to see some of the things you can accomplish with this language.

In addition, Groovy adds new methods and syntactical improvements Groovy is based on the Java programming language,Īnd for the most part you can pass straight Java code into the EvaluateGroovy function and it will work fine. ScriptMaster allows execution of Groovy code from within FileMaker.
