DAZ Script | |
---|---|
String | doAudioClipOpenDialog ( String startWith=“”, DzWidget parent=undefined ) |
String | doDirectoryDialog ( String title=“”, String desc=“”, DzWidget parent=undefined ) |
String | doDirectoryDialog ( String title, String desc, String startWith, DzWidget parent=undefined ) |
String | doFileDialog ( Boolean open, String title=“”, String startWith=“”, String filter=“”, Number selectedFilter=0, DzWidget parent=undefined ) |
String | doImageDialog ( Boolean open, String startWith=“”, DzWidget parent=undefined ) |
String | doVideoClipSaveDialog ( String startWith=“”, DzWidget parent=undefined ) |
Array | getOpenFileNames ( String dir=“”, String filter=“”, String title=“”, DzWidget parent=undefined ) |
A global static object available via the Global::FileDialog variable.
This object provides functions that display OS native file dialogs to the user.
String : doAudioClipOpenDialog( String startWith=“”, DzWidget parent=undefined )
A convenience file dialog that automatically creates a filter list for all audio formats the application can import and displays a file open dialog.
Parameter(s):
Return Value:
String : doDirectoryDialog( String title=“”, String desc=“”, DzWidget parent=undefined )
Display a dialog for the user to choose a directory.
Parameter(s):
Return Value:
Example:
Have the user select a directory.
var sPath = FileDialog.doDirectoryDialog( qsTr("Select a Directory") );
String : doDirectoryDialog( String title, String desc, String startWith, DzWidget parent=undefined )
Display a dialog for the user to choose a directory.
Parameter(s):
Return Value:
Example:
Have the user select a directory.
var sPath = FileDialog.doDirectoryDialog( qsTr("Select a Directory"), "", App.getDocumentsPath() );
String : doFileDialog( Boolean open, String title=“”, String startWith=“”, String filter=“”, Number selectedFilter=0, DzWidget parent=undefined )
Display a dialog for the user to choose a file.
Parameter(s):
true
, displays an open file dialog, otherwise displays a save file dialog.null
, its value is set to the index of the filter that corresponds to the selected file.Return Value:
Example:
Get the name of an existing jpeg file.
var sFilename = FileDialog.doFileDialog( true, qsTr("Select an Image File"), App.getImageMgr().getImportPath(), "JPEG Files (*.jpg)" );
Example:
Get the name of an existing image file (w/ additional filters).
var sFilename = FileDialog.doFileDialog( true, qsTr("Select an Image File"), "", "Image Files (*.tif *.tiff *.jpg);TIFF Files (*.tif *.tiff);JPEG Files (*.jpg)" );
Example:
Get the name of a text file to save to.
var sFilename = FileDialog.doFileDialog( false, qsTr("Save As"), "", "Text Files (*.txt)" );
String : doImageDialog( Boolean open, String startWith=“”, DzWidget parent=undefined )
A convenience file dialog that automatically creates a filter list for all image formats the application can import/export and displays a file open/save dialog.
Parameter(s):
true
, displays an open image dialog, otherwise displays a save image dialog.Return Value:
String : doVideoClipSaveDialog( String startWith=“”, DzWidget parent=undefined )
A convenience file dialog that automatically creates a filter list for all video formats the application can export and displays a file save dialog.
Parameter(s):
Return Value:
Array : getOpenFileNames( String dir=“”, String filter=“”, String title=“”, DzWidget parent=undefined )
Shows an open file dialog to the user that allows selection of multiple files.
Parameter(s):
Return Value:
Example:
Have the user select one or more image files.
var aFiles = FileDialog.getOpenFileNames( "", "Image files (*.tif *.jpg *.png)", qsTr("Select Image Files") );