FolderItem.Open
From Xojo Documentation
New in 2019r2.1
Supported on Desktop.
If the FolderItem is an app, the app is opened. If the FolderItem is a document, the document is opened using its default app. You can specify parameters to the app.
If the FolderItem is an app, the app is opened. If the FolderItem is a document, the document is opened using its default app.
Notes
parameters is the app's parameters to be passed to the app being opened. The optional parameter activate specifies whether the app should be opened frontmost or behind other apps. The default value is True (foreground). If you specify False, the app will attempt to open in the background, but this may not work with certain apps.
Open is not available in console applications.
MacOS does not open multiple copies of apps. If you need to open multiple copies of an app, you should use a Shell with the "open -n Appname.app" terminal command like this:
Var sh As New Shell
sh.Execute("open -n " + myApp.ShellPath)
Sample Code
This code displays a PDF file in the built-in PDF viewer:
pdfFile = FolderItem.ShowOpenFileDialog("")
If pdfFile <> Nil Then
pdfFile.Open
End If