User Tools

Site Tools

Exporter Settings


Below is an example demonstrating how you can iterate over all exporters and inspect them for any script accessible settings. These settings can then be used to control the exporter via script.

API Areas of Interest


Click the name of the example below to save it as a file.

// Define whether this script is being run in the IDE,
// and thereby printing to the console; which supports
// HTML since
var bIDE = true;
// Get the export manager
var oExportMgr = App.getExportMgr();
// Get the number of exporters
var nExporters = oExportMgr.getNumExporters();
// Declare variables we'll be using as we iterate
var oExporter, oSettings;
var sSettings;
// Iterate over all exporters
for( var i = 0; i < nExporters; i += 1 ){
	// Get the "current" exporter
	oExporter = oExportMgr.getExporter( i );
	// Create a new settings object to collect settings with
	oSettings = new DzFileIOSettings();
	// Cause the exporter to give up the goods,
	// without displaying its options dialog
	oExporter.getOptions( oSettings, false, "" );
	// Dump information about the exporter to the console/log,
	// so we can see what we're dealing with
	print( "-----------------------------" );
	print( String( "Class Name : %1" ).arg( oExporter.className() ) );
	print( String( "Description : %1" ).arg( oExporter.getDescription() ) );
	print( String( "Extension : %1" ).arg( oExporter.getExtension() ) );
	// Get the settings in string form
	sSettings = oSettings.toString();
	// If we're running in the IDE and the version is or newer
	if( bIDE && App.version64 >= 0x000400070000000c ){
		// Modify the string for display in the console, which now supports html
		sSettings = sSettings.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<br/>");
	print( sSettings );
	print( "\n" );