Mouli
Mouli

Reputation: 1651

Integrate an option to explorer context menu with Electron

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?

Upvotes: 19

Views: 4180

Answers (2)

conny
conny

Reputation: 10145

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.)

Upvotes: 0

Jens Habegger
Jens Habegger

Reputation: 5446

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:

Upvotes: 9

Related Questions