dotherightthing / focalpoint-multi-cropper

Add a focalpoint to an image and generate project-specific crops.
0 stars 0 forks source link

Show thumbnail image in Finder #1

Closed dotherightthing closed 1 year ago

dotherightthing commented 1 year ago

This didn't work:

app.on('web-contents-created', (e, contents) => {
  contextMenu({
    prepend: (defaultActions, parameters, browserWindow) => [
      {
        label: 'View in Finder',
        visible: parameters.mediaType === 'image',
        click: () => {
          const { srcURL } = parameters;
          // const pth = srcURL.replace(/%20/g, ' ')
          // const pth = path.normalize(srcURL);
          // shell.beep(); // ok
          shell.openPath(srcURL); // fails
          shell.showItemInFolder(srcURL); // fails
        }
      }
    ],
     window: contents,
     showSaveImageAs: true,
     showInspectElement: true
  });
})
dotherightthing commented 1 year ago

Added clickable Finder path in 3ecba488dbef7082f1c07fb38635a1377792db75