Skip to main content

LensStudio:Ui.IDialogs

Class

Interface for file and message dialogs.

Index

Example

// 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());

Extends

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame


selectFilesToOpen()

selectFilesToOpen(params, defaultPath): Path[]

Open a file selection dialog allowing multiple selections and return an array of selected file paths.

Parameters

ParameterType
paramsParams
defaultPathPath

Returns

Path[]


selectFileToOpen()

selectFileToOpen(params, defaultPath): Path

Open a file selection dialog and return the selected file path.

Parameters

ParameterType
paramsParams
defaultPathPath

Returns

Path


selectFileToSave()

selectFileToSave(params, defaultPath): Path

Open a file save dialog and return the selected file path.

Parameters

ParameterType
paramsParams
defaultPathPath

Returns

Path


selectFolderToOpen()

selectFolderToOpen(params, defaultPath): Path

Returns selected path, or an empty path if the dialog was cancelled.

Parameters

ParameterType
paramsParams
defaultPathPath

Returns

Path


selectFolderToSave()

selectFolderToSave(params, defaultPath): Path

Open a folder selection dialog for saving and return the selected folder path.

Parameters

ParameterType
paramsParams
defaultPathPath

Returns

Path