In connection with building a GUI for PkgTemplates, I’d like to have a file/directory picker. The whole thing is Blink.jl → Electron
→ HTML+JS
based.
<input>
tag doesn’t work as I need it, as it doesn’t return the full path (security limitation).
I’ve tried to use the dialog
module, as the web recommends for Electron
, but don’t get it to work:
<button onclick="openFile()">Select File</button>
// ..
<script>
const {dialog} = require('electron').remote;
function openFile() {
// alert("Hello! I am an alert box!!");
console.log(dialog.showOpenDialog({properties: ['openFile']}));
}
</script>
On clicking the button, nothing happens (or alert shown, if I uncomment it). Any ideas?
A workaround using NativeFileDialog.jl should be possible, but I’d just prefer to avoid an additional roundtrip through a Julia code.