Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  


Launches the file.

Component: Files
Version: 2.7
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: No

MBS( "Files.LaunchFile"; Path { ; NewInstance } )


Parameter Description Example value
Path Native path to the item to reveal. "/Users/cs/Desktop/Notes.rtf"
NewInstance Optional
Available in MBS FileMaker Plugin 7.2 or newer.
Whether to launch new app instance on Mac.
Default is 0.


Returns "OK" or error.


Launches the file.
The OS will lookup what application is associated with the file type and launch the application asking it to open the document.
This function needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.
See also Files.Launch if you need to pass application and document.
If you launch a folder path, the folder will open in Finder/Explorer.


Shows a folder in Finder on Mac:

MBS( "Files.LaunchFile"; "/Users" )

Write container to temp file and launch:

# get temp folder
Set Variable [$TempFolder; Value:MBS( "Folders.SystemTemporary" )]
# and file name from container
Set Variable [$name; Value:MBS( "Path.LastPathComponent"; test::myContainer )]
# add name to folder path
Set Variable [$TempPath; Value:MBS( "Path.AddPathComponent"; $TempFolder; $name )]
# now write temp file
Set Variable [$r; Value:MBS( "Files.WriteFile"; test::myContainer; $TempPath)]
# and launch file
Set Variable [$r; Value:MBS( "Files.LaunchFile"; $TempPath)]

Launch new copy of same app:

MBS("Files.LaunchFile"; "/Applications/FileMaker Pro 15 Advanced/FileMaker Pro"; 1)

See also

Example Databases

Files.Launch   -   Files.List

Feedback: Report problem or ask question.

MBS Xojo Plugins