Opening files using a URL
You can open a shared or local file or run a script in a file using a URL. When FileMaker Pro or FileMaker Go is installed, the following URL schemes are registered with the operating system so that URLs using these schemes are handled by FileMaker Pro or FileMaker Go:
-
fmp – The last installed version of the application handles URLs with this scheme.
-
fmpXX, where XX is the major version number of the application – Only the specified version of the application handles URLs with this scheme.
The complete format of the URL is shown below. Optional parameters are indicated by braces ({ }). Line breaks and indention are added for legibility.
fmpXX://{{account:password@}address/}filename {?script=scriptname {¶m=scriptparameter} {&option=optionvalue} {&$variablename{[repetitionnumber]}=value} }
-
account:password
is the account name and password of the file. -
address
is-
the DNS name or IP address of the host
-
~
to specify the user’s Documents folder -
$
to specify that the file is already open
-
-
filename
is the name of the FileMaker Pro file. Filenames are case sensitive for FileMaker Go but not for FileMaker Pro. The filename extension .fmp12 is not required. -
scriptname
specifies the name of a script to run. Script names are not case sensitive. -
scriptparameter
passes a script parameter toscriptname
. See Get(ScriptParameter) function. -
v19.1.3:
optionvalue
specifies how a running script is handled whenscriptname
is run. See Options for handling the current script when starting new scripts. -
variablename
,repetitionnumber
, andvalue
specify a local variable, its repetition number, and its value whenscriptname
is run. You can use the & symbol to append multiple local variables to the URL. See Using variables.
To open a file using a URL:
-
Launch a web browser on the intended client machine.
-
Enter the URL of the file into the browser’s address area using the first part of the URL format above.
fmpXX://{{account:password@}address/}filename
To run a script in a file using a URL:
-
Follow the steps above.
-
Append
?script=scriptname
to the URL.You can also append additional URL parameters shown above.
Notes
-
To allow a URL to run a FileMaker script, the user’s account must have the fmurlscript extended privilege enabled. See Editing extended privileges for a privilege set.
-
If spaces, slashes (/), or any other special characters are needed in a URL, be sure to replace them with the appropriate percent-encoded values required for valid URLs. For example, replace a space with %20 or a slash with %2F, or use the GetAsURLEncoded function.
Examples
fmp://My%20Addresses
fmp://192.168.10.0/My%20Addresses.fmp12
fmp://[2001:0DB8:85A3:08D3:1319:8A2E:0370:7334]/My%20Addresses.fmp12
fmp19://MyAccount:MyPassword@sales.example.com/My%20Addresses.fmp12
Open a file named Clients.fmp12 on a host and run the script named ListClients:
fmp://sales.example.com/Clients.fmp12?script=ListClients
Open a file named Clients.fmp12 on a host and run a script named ListClients after resuming a paused script (option 3), specifying a script parameter of TopClients and a local variable $NumberToList with a value of 10:
fmp://sales.example.com/Clients.fmp12?script=ListClients¶m=TopClients&option=3&$NumberToList=10
Open a local file named Clients.fmp12 in the user’s Documents folder with a script named ListClients:
fmp://~/Clients.fmp12?script=ListClients
Run the script ListClients from an open file named Clients.fmp12:
fmp://$/Clients.fmp12?script=ListClients
In a calculation, create a URL to open a file named Clients.fmp12 on a host and run the script named ListClients, specifying a script parameter that is percent-encoded:
"fmp://sales.example.com/Clients.fmp12?script=ListClients¶m=" & GetAsURLEncoded ( "a/b" )