Skip links

Script

FileMaker Script

What is a script in FileMaker?

With a Script can be used to automatically execute any number of processes in a FileMaker database. FileMaker supports the creation of any number of scripts per database, which can (theoretically) contain any number of commands. Script parameters can be used to pass any parameters between scripts.

Adding a new script up to FileMaker 13

Scripts can be created in FileMaker up to version 13 under the menu command [Scripts > Manage scripts] can be added and edited.

Script selection window in the script editor

To add a new script in FileMaker up to version 13, click on the button [New]. By clicking on the arrow symbol, you can optionally add an empty script, a standard script, a script folder or a separator.

Script folders can be used to arrange scripts hierarchically in the script editor.

In a standard script, the following commands are automatically inserted into the new script:

Activate scroll mode []
Go to Layout ["Current layout" (Current table)]
Show all data records

Adding a new script as of FileMaker 14

Scripts can be created in FileMaker version 14 and higher under the menu command [Scripts > Script workspace] can be added and edited.

Script workspace as of FileMaker 14

To add a new script in FileMaker version 14 or later, click the [+]and a new script is immediately created, which you can name as you wish. A script folder and a dividing line can now be created using the corresponding symbols in the [Scripts] under the symbol [+] can be created. Script folders can be used to arrange scripts hierarchically in the script editor.

Script parameters and global variables

FileMaker has supported the addition of script parameters to scripts for many years, allowing data to be exchanged between different scripts. A parameter can be added to each script call, which can be set within the script using the

Get ( ScriptParameter )

can be read out again. In principle, data can also be written to a global variable so that it can be read by all scripts within the same file. Script parameters, on the other hand, can also be passed across files.

Pass multiple script parameters

Although a script parameter in FileMaker always consists of only one line, several parameters can easily be transferred at the same time with the appropriate separators. The quotation mark |, which does not normally appear in other data, is a suitable separator.

Custom function "StringSplit"

The separation of a string can be simplified with a small custom function. You can integrate the following function into your FileMaker solution with FileMaker Pro Advanced and use it to split a string with separators into its individual entries:

StringShare ( String; Number ) =
If(number = 1;
    CharacterLinks ( String; (Position ( String; "|"; 1; 1))-1);
CharacterCenter ( String; (Position ( String; "|"; 1; Number-1))+1;
(Position ( String; "|"; 1; number)) - ((Position ( String; "|"; 1; number-1))+1))
)

Example

$string = "House|Boat|Car|"
StringShare ($string; 1) = "House"
StringShare ($string; 2) = "Boot"
StringShare ($string; 3) = "Auto"

Script trigger

FileMaker allows many different script triggers for different objects in order to be able to execute scripts for certain user interactions or time-controlled. For example, you can automatically execute scripts when a specific layout is called up, when a special key is pressed during a mouse click, when a field value is changed and for an almost infinite number of other actions.

More questions about FileMaker? It's quicker in person.

As part of our Coaching and training services we will be happy to inform you personally about the FileMaker functions you need for the development of your FileMaker solution. Of course, we will be happy to respond to your individual wishes. Billing is individual and fair in 15-minute increments. Pay conveniently by bank transfer or PayPal.

Related Einträge

Share this page:

ERP software as flexible as your company.
We will be happy to advise you.

Customizable ERP software for Mac, Windows and iOS.

You are here: Automate processes with FileMaker scripts