18

I'm building an app which should be integrated through an option in the context menu of Windows explorer and Mac finder. I couldn't find a relevant option in Electron's documentation.

For example, when I right-click a file in Windows explorer / Mac finder, I want this option from my Electron app to appear in that menu. Is it possible?

zzzzBov
  • 174,988
  • 54
  • 320
  • 367
Mouli
  • 1,621
  • 15
  • 20
  • Do you want the option to only show up when your application is running, or, have it there always and launch your application if necessary? Are the options static or dynamic? – Shawn Rakowski Jun 07 '16 at 14:12
  • @ShawnRakowski Have it there always and launch the app when the option is clicked. – Mouli Jun 08 '16 at 04:53

2 Answers2

8

This question is not actually related to Electron. It can be divided into two parts:

  1. Creating custom dynamic context menu entries during installation passing the respective selected file as command line argument to its target
  2. Node.js command line argument parsing

Creating custom dynamic context menu entries during installation

Windows:

OSX:

  • I really can't tell.

Node.js command line argument parsing

Multiple options exist for command line argument parsing in Node.js, here is just a handful I've been using in the past:

Community
  • 1
  • 1
Jens Habegger
  • 5,266
  • 41
  • 57
  • 2
    Don't you just hate it at SO that the more knowledge needed to answer the question the less votes it gets. We should be getting badges or a point multiplier for these types of answers. – Guy Coder Sep 03 '20 at 10:49
0

For the OS X / macOS case, one (the?) way is to make a service (in ~/Library/Services/ or /System/Library/Services/) that can receive the folder item(s) in question.

(Footnote 1: Note that services can be individually enabled/disabled in System Preferences, and the whole experience seems a little bit buggy during development sometimes.)

(Footnote 2: I've only done this via the Automator but I hope at least it gives you some pointer as to where to get started.)

conny
  • 9,973
  • 6
  • 38
  • 47