-->

“window.frame.openDialog” not able select files in

2019-04-15 20:38发布

问题:

Using window.frame.openDialog, I am not able to select the files from the Open dialog box in Mac OS X. I could select the directory but not the files. Is there any way to select the files?

My code is:

window.frame.openDialog({
  type: 'open',
  title: 'Open...',
  multiSelect: false,
  acceptTypes: {
    'Images': ['*.hwc']
  },
  dirSelect: false,
  initialValue: '/'
});

回答1:

In MAC it is not possible to select files using window.frame.openDialog, instead of you can search and select file using fs.readFile.