this open Mozilla Thunderbird Mailer with Text File as Attachment
Var a As FolderItem = New FolderItem("C:\Program Files\Mozilla Thunderbird\thunderbird.exe",FolderItem.PathModes.Native)
i used “” around because space in path. without “” the space would be a argument separator.
your problem is the mixed up fDoc & fApp
u will open the app with the pic as argument.
i think fDoc.Open(fApp.NativePath,True)
should be fApp.Open(fDoc.NativePath,True)
In theory and according to Xojo’s Documentation this should work (assuming the .app you’re launching is accepting a parameter, which is a shell path to a file that it’s going to open):
If that doesn’t work, another option would be to use a Shell(same assumption as above regarding parameters):
Dim s As New Shell
s.Execute("open -n " + fApp.ShellPath + " " + fDoc.ShellPath)
Having said that, just another thing to keep in mind:
That most likely won’t work on the latest macOS Versions. System Applications are located in a different folder/volume. You shouldn’t try to locate an .app like this, but ask the OS where to find the app with a specific BundleID (in your example this would be: com.apple.mail).
Here is an example project that shows how to find an .app by BundleID, list all possible “Application Directories”, list all applications that can deal with a given file: App Directories example
just opens Preview.app (which is asking for a file to be opened) when built with Xojo 2021r2.1
Makes me think that the revamped FolderItem(Xojo 2019r2: FolderItem updated to use latest OS APIs on macOS) is still not working as expected for this situation
If so… then Shell should be an alternative.