I think you are missing a left and right parenthesis…
ipcMain.handle('openBtn' , (event) => {
console.log("ipcMain.handle('openBtn' , (event)=>")
dialog.showOpenDialog({
defaultPath:app.getPath("desktop") ,
buttonLabel:'Select File To Edit'
}).then((result) => { console.warn("result = ", result) }); //<-- Notice the addition of the two parenthesis
});
Notice the left parenthesis before “result” and then the one after the second to last closing curly brace. (result) => is the parameter to your arrow function and the last ) is to finish off the then clause.
Now this isn’t to say all this will make everything magically work, but that should at least put you into syntax compliance.
result.filePaths[0] (though… if we’re explaining basic object accessors, perhaps you’re in a bit over your head using asynchronous callback lambda functions.)
Thanks to you’s ,
Oops , I missed this : filePaths String[] - An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.
didn’t realize it is an array .