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.
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.
Most helpful comment
You can use the
--argsoption toopen:Then log
process.argvfrom the main process and you should see--fooin there.See http://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac for more details.