showOpenDialogSync
abstract fun showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): ReadonlyArray<String>?(source)
the file paths chosen by the user; if the dialog is cancelled it returns undefined
.
The browserWindow
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 properties
to ['openFile', 'openDirectory']
on these platforms, a directory selector will be shown.