KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Opening documents in a specific external program using OPEN URL
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: July 1, 2024

The OPEN URL command can be used to open a document in the user’s default program for that file type. Examples may include opening an image in “Preview” on Mac or “Windows Photo Viewer” on Windows.

var $file_t : Text
var $fileName_t : Text
$fileName_t:="examplePhoto.png"
$file_t:=System folder(Desktop)+$fileName_t
OPEN URL($file_t)


An app name can be provided to open the document in a specific program if the user has it installed. The last line can be replaced with the following in order to open the image in Firefox, for example.

OPEN URL($file_t; "FireFox")