Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Launches the file or opens folder.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Files | 2.7 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
Path | Native path to the item to reveal. | "/Users/cs/Desktop/Notes.rtf" | |
NewInstance | Available in MBS FileMaker Plugin 7.2 or newer. Whether to launch new app instance on Mac. Default is 0. |
1 | Optional |
Returns "OK" or error.
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 Advanced.app"; 1)
Launch word file on Windows:
Set Variable [ $r; Value: MBS( "Files.LaunchFile"; "C:\Users\Christian\Desktop\test.docx" ) ]
Launch Script taking a list of files to launch:
Set Variable [ $list ; Value: Get(ScriptParameter) ]
#
# loop over file paths received
Set Variable [ $count ; Value: ValueCount($list) ]
Set Variable [ $index ; Value: 1 ]
If [ $index ≤ $count ]
Loop
# launch it
Set Variable [ $path ; Value: GetValue($list; $index) ]
Set Variable [ $r ; Value: MBS( "Files.LaunchFile"; $path ) ]
# wait half a second
Pause/Resume Script [ Duration (seconds): ,5 ]
#
# next
Set Variable [ $index ; Value: $index + 1 ]
Exit Loop If [ $index > $count ]
End Loop
End If
Open documents folder:
Set Variable [ $r; Value: MBS("Files.LaunchFile"; MBS("Folders.UserDocuments")) ]
Launch notes app:
MBS( "Files.LaunchFile"; "/System/Applications/Notes.app")
This function checks for a license.
Created 18th August 2014, last changed 4th April 2022