Often it is the desire of the developer to allow users to open a file on disk with the default application instead of 4D. This can be done on both Mac and Windows without knowing what the document's default application is, using the LAUNCH EXTERNAL PROCESS command.
On Mac OSX the UNIX command "open" can to be used along with the POSIX/UNIX path to the document as shown in the code below:
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
LAUNCH EXTERNAL PROCESS("open "+$Path_T)
The above code will open the "myDocument.doc" using whatever application has been set as the default application for the file type of ".doc". That could be Microsoft's Word, Apple's Pages, OpenOffice, NeoOffice, etc.
Note that the entire path is wrapped in quotes(""). This allows for any space characters that may be contained in any of the names in the path.
As explained in KB asset 75812: Using Launch External Process to run applications asynchronously, the SET ENVIRONMENT VARIABLE command used here causes 4D to execute the command without waiting for it to complete, in an asynchronous mode.
The same can be accomplished on Windows by following example #10 that is shown in the command's documentation.