I'm in a situation where I need to use the SWT function Program.launch()
but I also require to use it with arguments. Simply put: How can I achieve this? Is it even possible?
I have tried the "normal Mac way" of doing something like this:
Program.launch("/Applications/SomeApp.app --args myarg");
This was unsuccessful, and resulted in nothing happening (not even an error). I suspect this is because Program.launch()
doesn't run through just a command line, but some other OS-specific method. Doing just Program.launch("/Applications/SomeApp.app");
works fine, but obviously lacks the arguments.
My situation is more explained in this question about Java .apps that can open other .apps. In there I explain how using open
doesn't work, so I'm left with having to use alternatives, where Program.launch()
seems like a good option.
So basically, is there a way to apply program arguments using Program.launch()
?
Most similar topics I've read end up with the user migrating to another option, like open
.