Electron: Question: How to pass parameters to electron app from Mac's open command

Created on 26 Oct 2016  路  1Comment  路  Source: electron/electron

  • Operating system: OS

Hi, I want to know if there is way to receive the parameters passes from "open" command in Mac. I want to use "Open" command open my app, and also passing some parameters to electron when doing so, like my current file path, etc. Many thanks in advance.

discussion

Most helpful comment

You can use the --args option to open:

open Electron.app --args --foo

Then log process.argv from the main process and you should see --foo in there.

See http://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac for more details.

>All comments

You can use the --args option to open:

open Electron.app --args --foo

Then log process.argv from the main process and you should see --foo in there.

See http://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac for more details.

Was this page helpful?
0 / 5 - 0 ratings