#target bridge /*-------------------------------------------------------------------------------------------------------------- ADOBE SYSTEMS INCORPORATED Copyright 2006 - Adobe Systems Incorporated All Rights Reserved If this file is provided by Adobe in modifiable form (e.g., source code or JavaScript), then you may modify this file. You may use and distribute this file, in modified or unmodified form, provided that you must reproduce the above acknowledgement and this notice with all copies of the file. THIS SOFTWARE IS PROVIDED BY ADOBE SYSTEMS INCORPORATED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ADOBE BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------------------------------------*/ /* ExportToSWF_AI.jsx Author: Bob Stucky Description: Exports Selected images to SWF Version: 2.0.6 Dated: 10/25/2006 */ /* @@@BUILDINFO@@@ ExportToSWF_AI.jsx 2.0.0.6 1.0000 25-Oct-2006 */ $.level = 0; if (BridgeTalk.appName == "bridge" ) { var ExportToSWFAI = {}; WasLib.createAppMenus(); WasLib.createMenu( "menu", localize("$$$/WAS/ETFAIExporttoSWFAIMENU=Illustrator"), "at the end of tools", "tools/ai" ); // create main menu object WasLib.createMenu( "menu", localize("$$$/WAS/ETFAIExporttoSWFExpMENU=Export to SWF"), "at the end of tools/ai", "tools/ai/ExportToSWF" ); // create menu for Simple Export var ExportToSWFAIQuick = WasLib.createMenu( "command", localize("$$$/WAS/ETFAIQuickExport=Quick Export"), "at the end of tools/ai/ExportToSWF", "tools/ai/ExportToSWF/QuickExport"); ExportToSWFAI.executeQuick = function( ) { var options = "var opt = new ExportOptionsFlash(); opt.resolution = 72; "; //var files = WasLib.cullFolders( WasLib.getBridgeFiles( WasLib.fileFilters.getValue( "Illustrator Openable" ) ) ); // Watson 1463927: noted against ContactSheet_ID.jsx but exactly same bug applies to this script var files = WasLib.getBridgeFilesOnlyIgnoringFolders( WasLib.fileFilters.getValue( "Illustrator Openable" ) ); var bti = new WasLib.BridgeTalkIterator( true, localize("$$$/WAS/QuickExp=Quick Export..."), localize("$$$/WAS/QuickExp2=Quick Export..."), false ); for ( var i in files ) { var scpt = getExportToSWFScript( files[ i ], options ); bti.addMessage( "illustrator", scpt, decodeURI( files[ i ].name ) ); } bti.send(); } ExportToSWFAIQuick.onSelect = ExportToSWFAI.executeQuick; // create menu for Custom Export ExportToSWFAI.menu = WasLib.createMenu( "command", localize("$$$/WAS/ETFAICustomExport=Custom Export..."), "at the end of tools/ai/ExportToSWF", "tools/ai/ExportToSWF/CustomExport"); ExportToSWFAI.executeCustom = function() { // init the dialog ExportToSWFAI.initDialog(); // show the dialog ExportToSWFAI.showDialog(); } ExportToSWFAI.menu.onSelect = ExportToSWFAI.executeCustom; // add actions for ok ExportToSWFAI.ok = function() { // holds code for the options to pass to AI var options = "var opt = new ExportOptionsFlash();"; // set export style options += 'opt.exportStyle = FlashExportStyle.'; switch (ExportToSWFAI.dialog.typeDD.selection.index) { case 0: options += 'ASFLASHFILE;'; break; case 1: options += 'LAYERSASFRAMES;'; options += 'opt.frameRate = ' + ExportToSWFAI.dialog.options.rateEt.text + ';'; options += 'opt.looping = ' + ExportToSWFAI.dialog.options.loopCb.value + ';'; options += 'opt.layerOrder = LayerOrderType.' + ExportToSWFAI.dialog.options.layerOrderDD.selection.value + ';'; if(ExportToSWFAI.dialog.options.blendsOptGrp.enabled) { if(ExportToSWFAI.dialog.options.blendRb1.value == true) { options += 'opt.blendAnimation = BlendAnimationType.INBUILD;'; } else if(ExportToSWFAI.dialog.options.blendRb2.value == true) { options += 'opt.blendAnimation = BlendAnimationType.INSEQUENCE;'; } } break; case 2: options += 'LAYERSASFILES;'; break; } //options += 'opt.generateHTML = ' + ExportToSWFAI.dialog.options.htmlCb.value + ';'; options += 'opt.artBoardClipping = ' + ExportToSWFAI.dialog.options.clipCb.value + ';'; options += 'opt.readOnly = ' + ExportToSWFAI.dialog.options.protectCb.value + ';'; options += 'opt.convertTextToOutlines = ' + ExportToSWFAI.dialog.options.outlineCb.value + ';'; options += 'opt.compressed = ' + ExportToSWFAI.dialog.options.compressCb.value + ';'; // set method options if (ExportToSWFAI.dialog.options.flattenRb1.value == true) { options += 'opt.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;'; } else { options += 'opt.flattenOutput = OutputFlattening.PRESERVEPATHS;'; } // set curve quality options += 'opt.curveQuality = '+ExportToSWFAI.dialog.options.curveSlider.value+';'; // set image options if (ExportToSWFAI.dialog.options.lossRb1.value == true) { options += 'opt.imageFormat = FlashImageFormat.LOSSLESS;'; } else { options += 'opt.imageFormat = FlashImageFormat.LOSSY;'; if (ExportToSWFAI.dialog.options.methodRb1.value == true) { options += 'opt.jpegMethod = FlashJPEGMethod.Standard;'; } else { options += 'opt.jpegMethod = FlashJPEGMethod.Optimized;'; } options += 'opt.jpegQuality = ' + ExportToSWFAI.dialog.options.qualityDD.selection.value + ';'; } var scpt = ''; // get selected files //var files = WasLib.cullFolders( WasLib.getBridgeFiles( WasLib.fileFilters.getValue( "Illustrator Openable" ) ) ); // Watson 1463927: noted against ContactSheet_ID.jsx but exactly same bug applies to this script var files = WasLib.getBridgeFilesOnlyIgnoringFolders( WasLib.fileFilters.getValue( "Illustrator Openable" ) ); // create iterator... WasLib.BridgeTalkIterator = function( showProgress, text, title, notifyComplete ) { var bti = new WasLib.BridgeTalkIterator( true, localize("$$$/WAS/ETFAICustomExport=Custom Export..."), localize("$$$/WAS/ETFAICustomExport=Custom Export..."), false ); for (var i=0; i