This method is not supported for console and mobile projects.
But just below that notice is an example of how to open an app from a Console app using Shell on macOS. I’m sure there is a similar way on Windows if needed.
It won’t work on Mac OS because console apps don’t have a connection to the window server (provides GUI), which is what FolderItem.Launch requires.
Try this, if you’re on the Mac: in your console app, create a Shell and execute “/usr/bin/open /path/to/executable”. That should launch any GUI or console app.
This method is not supported for console and mobile projects.
You have now idea how bad I felt when I found this in the documents before opening this thread. Glad to know I am the only one who misses things!
Where do you change from API-1 to API-2? I looked under build settings, where i thought it was but there is nothing there.
But just below that notice is an example of how to open an app from a Console app using Shell on macOS. I’m sure there is a similar way on Windows if needed.
I didn’t see any attachments. Another error on my part?
Ok, I “kind of” have my program running, but it brings up some questions.
This works for me:
sh.Execute ("open -a /Applications/myMovieScreenSaver.app”)
However if I to this:
sh.Execute ("/usr/bin/open -a /Users/michaelcebasek/Documents/xojo programs/myMovieScreenSaver/Builds - myMovieScreenSaver9/macOS Universal/myMovieScreenSaver.app”)
It doesn’t work.
Looking through the man open, I know -a is for application start, but shouldn’t this work in a “general” (not restricted, and on my computer I am an administrator) folder like Dcouments?
I did forget to mention (since I was doing this at 0330 Eastern Time) That I took a copy of the app and put it directly into my Documents folder, using the shell execute
sh.execute (“open -a /Documents/myMovieScreenSaver.app”)
You should use the full path, but instead try using FolderItem.shellPath which will return a path with “funny” characters escaped so you don’t need to do quoting: