Shortcut parameter

Is there a way to get a parameter that is passed on the startup of an application?

In Windows, this would be passed in the shortcut. On the Mac, I’m not exactly sure how you would pass that parameter.

On Mac you would need to start the app by command line. In a Console app these are passed to you in the Run event, but for Desktop you’ll need something like App.ArgumentsMBS to get them.

In a console application, you get the parameters in the Event ConsoleApplication.Run.

And if you don’t want to use a Plugin, then just use what is built-in Xojo :wink:

In a Desktop application, you can use System.CommandLine.

Launch a Desktop application via a (Shell)Script, or using Terminal: /path/to/test.app/Contents/MacOS/test -abcd
In a Desktop application, the result of System.Commandline would then be /path/to/test.app/Contents/MacOS/test -abcd

How do you pass args from a Finder’s Open or Double-click ?

@Emile Schwarz — You can’t do it from the Finder. You need to use a shell, a script or a launch agent.