// Copyright © 2007. Adobe Systems Incorporated. All Rights Reserved. // //-------------------------- Flash-9.0.jsx Version 1.0.1 ----------------------- // // ADOBE SYSTEMS INCORPORATED // Copyright 2005 Adobe Systems Incorporated // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute // this file in accordance with the terms of the Adobe license // agreement accompanying it. If you have received this file // from a source other than Adobe, then your use, modification, // or distribution of it requires the prior written permission // of Adobe. // //------------------------------------------------------------------------------ /* @@@START_XML@@@ Adobe Flash CS3 Professional This script enables other applications to communicate with Adobe Flash. Adobe Flash CS3 Professional Ce script permet à d'autres applications de communiquer avec Adobe Flash. Adobe Flash CS3 Professional このスクリプトは、他のアプリケーションと Adobe Flash との通信を有効にします。 Adobe Flash CS3 Professional Mithilfe dieses Skripts können andere Anwendungen mit Adobe Flash kommunizieren. Adobe Flash CS3 Professional Questo script consente ad altre applicazioni di comunicare con Adobe Flash. Adobe Flash CS3 Professional Este script posibilita que otras aplicaciones se comuniquen con Adobe Flash. Adobe Flash CS3 Professional Dit script laat andere toepassingen toe te communiceren met Adobe Flash. Adobe Flash CS3 Professional Este script permite que outros aplicativos se comuniquem com o Adobe Flash. Adobe Flash CS3 Professional Skriptet gjør at andre programmer kan kommunisere med Adobe Flash. Adobe Flash CS3 Professional Dette script betyder, at andre programmer kan kommunikere med Adobe Flash. Adobe Flash CS3 Professional Tämän komentosarjan avulla muut sovellukset ja Adobe Flash voivat kommunikoida keskenään. Adobe Flash CS3 Professional Det här skriptet gör det möjligt för andra program att kommunicera med Adobe Flash. Adobe Flash CS3 Professional "此指令碼能讓其他應用程式與 Adobe Flash 進行通訊。 Adobe Flash CS3 Professional "此脚本使其它应用程序能够与 Adobe Flash 进行通信 Adobe Flash CS3 Professional "이 스크립트를 사용하면 다른 응용 프로그램에서 Adobe Flash과(와) 통신할 수 있습니다. @@@END_XML@@@ */ //-------------------------------------------------------------------- // FLASH COMMON INTERFACE //-------------------------------------------------------------------- var FL = new Object(); var fl = FL; // Also support var flashAppName = "flash-9.0-en_us"; var bridgeAppName = "bridge"; //--------------------------------------------------------- // quit - If open, Quit the Flash application // FL.quit = function ( ) { if (BridgeTalk.isRunning(flashAppName)) // First check if Flash is open { FL.sendScriptToFlash( 'fl.quit();' ); } } //--------------------------------------------------------- // open - Open list of files or sites // FL.open = function ( files ) { FL.sendScriptToFlash( 'fl.openDocument('+FL.argsToString(arguments)+');'); } //--------------------------------------------------------- // reveal - If the specified file is open, show it // FL.reveal = function ( file_location ) { FL.sendScriptToFlash( 'app.reveal('+FL.argsToString(arguments)+');'); } //--------------------------------------------------------- // executeScript - Execute the specified script files // FL.executeScript = function ( script_file ) { return FL.sendScriptToFlash( 'app.executeScript('+FL.argsToString(arguments)+');'); } //-------------------------------------------------------------------- // FLASH SPECIFIC CODE //-------------------------------------------------------------------- if( app.name == flashAppName && (module.name == 'DefaultScript' || module.name == 'Flash') ) { eval( 'BridgeTalk.onReceive = function( obj ) { return eval( obj.body, true ); }', true ); } // End of Flash specific code //-------------------------------------------------------------------- // BRIDGE UI //-------------------------------------------------------------------- //--------------------------------------------------------- // Create Bridge Specific UI // if( BridgeTalk.appName == bridgeAppName ) { // create main menu object var placeInFlashMenu = MenuElement.create( 'command', localize("$$$/extendscript/flash/PlaceInFlash/PlaceInFlashStage=In Flash"), 'at the end of submenu/Place', 'PlaceInFlashStage' ); var placeInFlashLibMenu = MenuElement.create( 'command', localize("$$$/extendscript/flash/PlaceInFlash/PlaceInFlashLib=In Flash Library"), 'at the end of submenu/Place', 'PlaceInFlashLib' ); // open file on stage placeInFlashMenu.onSelect = function() { //Get the files, may be remote/version cue var sel = app.document.selections; app.acquirePhysicalFiles(sel); var filesArray = FL.thumbnailsToFiles(sel); if (filesArray != null) FL.place(filesArray, false); } // open file in document's library placeInFlashLibMenu.onSelect = function() { // Get the files, may be remote/version cue var sel = app.document.selections; app.acquirePhysicalFiles(sel); var filesArray = FL.thumbnailsToFiles(sel); if (filesArray != null) FL.place(filesArray, true); } placeInFlashMenu.onDisplay = function() { this.enabled = false; //??? BridgeTalk.isRunning is always returning false #1116359, so always enabling menu even if Flash is not running //??? if( BridgeTalk.isRunning('flash') && app.document.selections.length > 0 ) if( app.document.selections.length > 0 ) this.enabled = true; } placeInFlashLibMenu.onDisplay = function() { this.enabled = false; //??? BridgeTalk.isRunning is always returning false #1116359, so always enabling menu even if Flash is not running //??? if( BridgeTalk.isRunning('flash') && app.document.selections.length > 0 ) if( app.document.selections.length > 0 ) this.enabled = true; } } // End of Bridge specific code //-------------------------------------------------------------------- // UTILITIES //-------------------------------------------------------------------- //--------------------------------------------------------- // sendScriptToFlash - Send script to be evaluated in Flash // // Description: // FL.sendScriptToFlash = function( code ) { //alert("Sending: '"+code+"'"); if (app.name == flashAppName ) { // Just execute the code if we are already in Flash return eval(code); } else { // Create a new BridgeTalk message for Flash to invoke Quit var btMessage = new BridgeTalk; btMessage.target = flashAppName; btMessage.body = code; btMessage.onResult = function() {BridgeTalk.bringToFront(flashAppName);} btMessage.send(); } } //--------------------------------------------------------- // argsToString - // // Description: // This routine create a string for the arguments that we can transmit // over BridgeTalk as text. // FL.argsToString = function ( args ) { alert("In argsToString"); var outArgs = new Array(); for( var index=0; index