showOpenDialogSync
the file paths chosen by the user; if the dialog is cancelled it returns undefined.
The window argument allows the dialog to attach itself to a parent window, making it modal.
The filters specifies an array of file types that can be displayed or selected when you want to limit the user to a specific type. For example:
The extensions array should contain extensions without wildcards or dots (e.g. 'png' is good but '.png' and '*.png' are bad). To show all files, use the '*' wildcard (no other wildcard is supported).
!NOTE On Windows and Linux an open dialog can not be both a file selector and a directory selector, so if you set
propertiesto['openFile', 'openDirectory']on these platforms, a directory selector will be shown.
!NOTE On Linux
defaultPathis not supported when using portal file chooser dialogs unless the portal backend is version 4 or higher. You can use--xdg-portal-required-versioncommand-line switch to force gtk or kde dialogs.