# Shortcut parameter

**URL:** <https://forum.xojo.com/t/shortcut-parameter/52283>\
**Category:** Getting Started\
**Created:** [February 5, 2020, 5:16pm UTC](https://forum.xojo.com/t/shortcut-parameter/52283 "2020-02-05T17:16:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Fatte](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/4bbf92/32.png) [@John\_Fatte](https://forum.xojo.com/u/John_Fatte)\
**Post date:** [February 5, 2020, 5:16pm UTC](https://forum.xojo.com/t/shortcut-parameter/52283/1 "2020-02-05T17:16:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [February 5, 2020, 5:22pm UTC](https://forum.xojo.com/t/shortcut-parameter/52283/2 "2020-02-05T17:22:59Z")

</div>

> [@474260:@John Fatte](#):
>
> 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](https://www.monkeybreadsoftware.net/process-application-method.shtml#4) to get them.

---

<div class="post-metadata">

**Author:** ![Jürg\_Otter](https://forum.xojo.com/user_avatar/forum.xojo.com/j%C3%BCrg_otter/32/584_2.png) [@Jürg\_Otter](https://forum.xojo.com/u/J%C3%BCrg_Otter)\
**Post date:** [February 5, 2020, 7:59pm UTC](https://forum.xojo.com/t/shortcut-parameter/52283/3 "2020-02-05T19:59:24Z")

</div>

> [@474260:@John Fatte](#):
>
> Is there a way to get a parameter that is passed on the startup of an application?

In a console application, you get the parameters in the Event [ConsoleApplication.Run](https://documentation.xojo.com/api/language/consoleapplication.html#consoleapplication-run).

> [@474261:@Tim Parnell](#):
>
> but for Desktop you’ll need something like App.ArgumentsMBS to get them.

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

In a Desktop application, you can use [System.CommandLine](https://documentation.xojo.com/api/os/system.html#system-commandline).

> [@474260:@John Fatte](#):
>
> On the Mac, I’m not exactly sure how you would pass that parameter.

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`

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 6, 2020, 9:30am UTC](https://forum.xojo.com/t/shortcut-parameter/52283/4 "2020-02-06T09:30:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Stéphane\_Mons](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@Stéphane\_Mons](https://forum.xojo.com/u/St%C3%A9phane_Mons)\
**Post date:** [February 6, 2020, 2:35pm UTC](https://forum.xojo.com/t/shortcut-parameter/52283/5 "2020-02-06T14:35:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:16pm UTC](https://forum.xojo.com/t/shortcut-parameter/52283/6 "2021-04-29T16:16:47Z")

</div>


