How to open the TextEdit app with a text document (whose extension is not .txt but .out) ?
I tried this (without success)
Var sh As New Shell
sh.Execute("open -n " + TextEdit.app)
Thanks
How to open the TextEdit app with a text document (whose extension is not .txt but .out) ?
I tried this (without success)
Var sh As New Shell
sh.Execute("open -n " + TextEdit.app)
Thanks
Monterey told me that (above).
My answer is … use:
https://documentation.xojo.com/api/files/folderitem.html.Open
but TextEdit is not the default application to open that archaic type of file. (wikipedia)
What happens when you drag the .out file over the TextEdit app ?
Shouldn’t this be:
sh.Execute ("open -a TextEdit.app Notes.out")
it open it. wikipedia says it holds text data…
TextEdit can also open binary files.
Syntax error !
Another suggestion?
sh.Execute("open -a TextEdit.app Notes.out")
sh.Execute("open -a TextEdit.app")
>> Syntax error.
Double dot “.” ! Excuse me.
still not working…
dim fap As folderitem = SpecialFolder. Applications.Child("TextEdit.app")
Shell1.Execute("open -n " + fap.ShellPath)
(try with "open -a" too)
Error message : "The file /Applications/TextEdit.app does not exist."

Is TextEdit.app in your Applications folder? It is on my machine.
Yes, there is. That is why I do not understand.
That path is to your user Application directory, you should be targeting /Applications, not ~/Applications
The open command uses the “-e” option to open the specified file in TextEdit.
This code works for me:
RunShell = New Shell // Property RunShell As Shell
Var file As FolderItem = SpecialFolder.Desktop.Child("simple.out")
RunShell.Execute("open -e " + file.ShellPath)
I would highly suggest to use an API and not command line to open it.
Like using LaunchServicesOpenXMBS function in MBS Xojo Plugins.
Works for me too ! Thank you very much @Paul_Lefebvre (and @Emily-Elizabeth_Howard too)