Hi, I want the file picker to be opened with a preselected file.
I understand, that because of security reasons, only files in predefined folders can be opened without user interaction. For my use case it’s okay to open the file picker and let the user click the open button. But I want to help the user by preselecting a specific file.
I hoped, that fs.getFileForOpening({initialLocation: "/Users/<username>/myFilePathString.psd"}) could help but the function only accepts File or Folder.
Is there another possibility?
Thanks Davide for your reply!
My example was not really very well chosen since the important thing is not, that the file for opening is in the user’s directory but is a path to an existing file somewhere on the disk. The ideal handling for me would be to call getFileForOpening with the path and if the file exists it is pre-selected, if not, a default folder is opened instead.
My current workaround is to let the OS open that file.