Interface for file and message dialogs.
// IDialogs provides file and folder selection dialogs via gui.dialogs. const gui = this.pluginSystem.findInterface(IGui.interfaceId) as IGui; if (Editor.isNull(gui)) { console.log('IGui not available'); return; } const dialogs: IDialogs = gui.dialogs; // Open a file selection dialog const params = {} as Dialogs.Params; params.caption = 'Select an Image'; params.filter = 'Images (*.png *.jpg *.jpeg)'; params.options = Dialogs.Options.Usual; const defaultPath = new Editor.Path(''); const filePath = dialogs.selectFileToOpen(params, defaultPath); console.log('Selected file:', filePath.toString()); Copy
// IDialogs provides file and folder selection dialogs via gui.dialogs. const gui = this.pluginSystem.findInterface(IGui.interfaceId) as IGui; if (Editor.isNull(gui)) { console.log('IGui not available'); return; } const dialogs: IDialogs = gui.dialogs; // Open a file selection dialog const params = {} as Dialogs.Params; params.caption = 'Select an Image'; params.filter = 'Images (*.png *.jpg *.jpeg)'; params.options = Dialogs.Options.Usual; const defaultPath = new Editor.Path(''); const filePath = dialogs.selectFileToOpen(params, defaultPath); console.log('Selected file:', filePath.toString());
Protected
Snap Hidden
Returns the name of this object's type.
Returns true if the object is of the specified type.
Returns true if this object refers to the same instance as the given object.
Open a file selection dialog allowing multiple selections and return an array of selected file paths.
Open a file selection dialog and return the selected file path.
Open a file save dialog and return the selected file path.
Returns selected path, or an empty path if the dialog was cancelled.
Open a folder selection dialog for saving and return the selected folder path.
Interface for file and message dialogs.
Example