I wonder if there is a solution to open only one file directly without using showOpenFilePicker() function?
I don't want to let other users to pick a different file but API would use only the correct one. I have a root and name of file.
FROM:
this.getFileAsText = async function () {
var [fileHandle] = await window.showOpenFilePicker();
var fileData = await fileHandle.getFile();
return text = await fileData.text();
}
TO:
this.getFileAsText = async function () {
var [fileHandle] = await directFile(myPath/test.txt);
var fileData = await fileHandle.getFile();
return text = await fileData.text();
}
thanks