Open URL from a FileMaker script

Beginner

Launch web pages, mailto links, and custom URL schemes from scripts using the Open URL step, with error handling for unsupported schemes.

What you'll learn

  • How to open a web URL from a FileMaker script
  • How to construct a mailto: link with pre-filled subject and body
  • How to open a custom URL scheme to launch another app
  • Why Open URL does nothing in server-side scripts
  • How to build the URL dynamically from field data

Open URL passes a URL string to the operating system, which opens it in the default application for that scheme. This covers web pages (https://), email (mailto:), FaceTime (facetime:), and any custom URL scheme registered on the device. In server-side scripts (FMSA scheduled scripts) Open URL does nothing -- it requires a client session.

1/3
1

Open a web URL from a field value

Build the URL string in a variable, validate it is not empty, then call Open URL with the "No dialog" option to suppress any system confirmation prompt.

FileMaker Script
Set Variable [ $url ; Value: Trim ( Contacts::WebsiteURL ) ]

If [ IsEmpty ( $url ) ]
  Show Custom Dialog [ "No website URL is on file for this contact." ]
  Exit Script [ Text Result: "empty" ]
End If

# Add https:// if no scheme is present
If [ Left ( $url ; 4 ) != "http" ]
  Set Variable [ $url ; Value: "https://" & $url ]
End If

Open URL [ No dialog ; URL: $url ]

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo