AdobeBridgeCS5SDK

AdobeBridgeCS5SDK

This document is the API Specification for AdobeBridgeCS5SDK.

Summary

This is documentation for the JavaScript sample code in the Adobe Bridge CS5 SDK. All the sample code contained within the SDK should be run from the ExtendScript Toolkit (ESTK) CS5. The sample code can be divided into two main categories:

1. Code snippets, which are fragments of scripting code demonstrating an API call or small set of API calls. These cover topics such as:

2. More elaborate samples, which are typically longer scripts demonstrating extensibility. These samples cover topics such as:

Running the Snippets

Snippets can be found in JavaScript (.jsx) files, where the filename begins with "Snp". Samples have names that describe the intent of the sample. Almost all JavaScript files can be executed directly in the ESTK, with the exception of some helper JavaScript files (for instance, SDKNode.jsx, SDKSystem.jsx) The snippets contain instructional comments that explain how to run the snippet and what, if any, additional context needs to be set up for the snippet to run correctly. To run a snippet, we recommend you perform the following steps:
  1. Start Adobe Bridge CS5.
  2. Start ExtendScript Toolkit CS5.
  3. From ExtendScript Toolkit, open the .jsx file that you want to run.
  4. In the "targets" drop-down list, select Bridge CS5 / Main Engine.
  5. Check the documentation for the snippet you want to run to find the preconditions it requires; for instance, some snippets or samples require you to select one or more thumbnails in Bridge of a particular kind before running the code.
  6. Return to the ExtendScript Toolkit and run the snippet using the Run button (rightward-pointing triangle) above the editor window.

Running the Samples

Samples can be found in JavaScript (.jsx) files; one sample file may contain several JavaScript classes. Samples are run in the same manner as the snippets, from within the ExtendScript Toolkit. Check the documentation within each sample for any preconditions that may be required in order to run the sample successfully.

About the Snippets and Samples

The snippets and samples are intended as instructional code. Most debug information and feedback from the snippets is via the JavaScript console in the ExtendScript Toolkit. Unless it is their main purpose or essential to their operations, the snippets avoid creating user interface elements in Adobe Bridge CS5, to keep the code as straightforward as possible.

Most of the snippets have two methods in common, canRun() and run(). The run() methods contain most of the functional code. The canRun() method checks if the correct context has been setup for the snippet to run, for example that Bridge is actually running. Some snippets do not contain a canRun() as they can always be run regardless of whether the target is ExtendScript Toolkit or Adobe Bridge CS5. If a snippet has run and the result is not as expected then check the JavaScript console in the ESTK.

The source code for all snippets and samples can also be found within these pages.


Snippets Broken down by Area
Bridge API SnpAddPreferencesPanel SnpDefineAppClosingHandler SnpInspectMetadata SnpLoadSavedWorkspace SnpListenDocEvents SnpModifyMetadata SnpRotateImage SnpSaveAsJPEG SnpScheduleTask
Bridge UI FlashDemo SnpAddContextMenuItem SnpAddMenuItem SnpAddScriptUINavBar SnpCreateFlashControl SnpCreateIconInspectorPanel SnpCreateTabbedPaletteScriptUI SnpCreateTextInspectorPanel SnpCreateThumbInspectorPanel SnpCreateWebTabbedPalette SnpLoadSavedWorkspace
Script UI AlertBoxBuilder1 AlertBoxBuilder2 ColorSelector FlashDemo SnpAddScriptUINavBar SnpCreateCheckBoxRadioButtons SnpCreateDialog SnpCreateDynamicScriptUI SnpCreateFlashControl SnpCreateProgressBar SnpCreateSlider SnpCreateTabbedPaletteScriptUI SnpCreateTreeView SnpCreateUIAddMethod SnpCreateUIResourceSpec SnpCustomLayoutManager
Node Extensibility BasicExtensionHandler CustomInfosetExtensionHandler CustomSearchExtensionHandler SDKNode SDKSystem
Inter-Application Communication SnpOpenInPhotoshop SnpSaveAsPNG SnpSendArray SnpSendCustomObject SnpSendDOMObject SnpSendMessage SnpSendMessageToInDesign
External Communication AsynchronousFtp BackgroundEmailer BasicEmailer BasicFTP


File Summary
AsynchronousFTP.jsx Sample that shows hows to upload files asynchronously from Adobe Bridge to an FTP server; to run this, you must modify the code and supply FTP settings to access your own FTP server.
BackgroundEmailer.jsx Sample using the Socket object to send email with attachments as a background (scheduled) task.
BasicEmailer.jsx Shows how to use the Socket object to send emails with attachments from Bridge.
BasicExtensionHandler.jsx Demonstrates a basic implementation of a node-handling extension, in which the model is read-only.
BasicFTP.jsx Shows how to upload and download files to and from an FTP server.
CustomInfosetExtensionHandler.jsx Demonstrates a basic implementation of a node-handling extension with a custom Infoset.
CustomSearchExtensionHandler.jsx Demonstrates how to implement a custom node search with a node-handling extension.
CustomSortExtensionHandler.jsx Demonstrates how to implement a custom sorting and filters with a node-handling extension.
FlashDemo.jsx Shows how to communicate with a ScriptUI FlashPlayer in Adobe Bridge using ActionScript
FlashExportToJpeg.jsx Sample that shows a Flash Palette in Bridge that exports the current items selected in Bridge to JPEG files.
SDKNode.jsx Supporting class; backing node for extension handling samples.
SDKSystem.jsx Supporting class; manages the backing nodes used for extension handling samples.
SnpAddContextMenuItem.jsx Shows how to add a custom menu element to a context menu in Bridge.
SnpAddMenuItem.jsx Shows how to add a custom menu element to Bridge.
SnpAddPreferencesPanel.jsx Shows how to add a custom option to the Preferences dialog.
SnpAddScriptUINavBar.jsx Shows how to display ScriptUI components in the bottom navigation bar.
SnpCreateFlashControl.jsx Shows how to load and run a Flash movie in Bridge using the ScriptUI FlashPlayer.
SnpCreateIconInspectorPanel.jsx Shows how to create and display an object-inspector panel using the InpsectorPanel object, with an icon-list-type subpanel, an IconListPanelette object.
SnpCreateTabbedPaletteScriptUI.jsx Shows how to create a TabbedPalette in Bridge with ScriptUI components.
SnpCreateTextInspectorPanel.jsx Shows how to create and display an object-inspector panel using the InpsectorPanel object, with a text-type subpanel, a TextPanelette object.
SnpCreateThumbInspectorPanel.jsx Shows how to create and display an object-inspector panel using the InpsectorPanel object, with a thumbnail-type subpanel, a ThumbnailPanelette object.
SnpCreateWebTabbedPalette.jsx Shows how to create a TabbedPalette that shows a Web page.
SnpDefineAppClosingHandler.jsx Shows how to create an event handler that responds to the application close event.
SnpInspectMetadata.jsx Shows how to acquire metadata for a selected thumbnail using XMP external object.
SnpListenDocEvents.jsx Shows how to create separate event handlers for different events.
SnpLoadSavedWorkspace.jsx Shows how to load a previously saved workspace, which you have copied to the appropriate location for saved workspaces.
SnpModifyMetadata.jsx Shows how to acquire and update metadata for a selected thumbnail using XMP external object.
SnpMoveTabbedPalette.jsx Shows how to place a TabbedPalette in Bridge in a custom location via scripting.
SnpOpenInPhotoshop.jsx Shows how to use the cross-DOM to open a file selected in Bridge in another Adobe application.
SnpRotateImage.jsx Shows how to use a BitmapData object to create and rotate images.
SnpSaveAsJPEG.jsx Shows how to save multiple files as JPEG images using BitmapData.
SnpSaveAsPNG.jsx Shows how to send one or more files from Adobe Bridge CS5 to Adobe Photoshop CS5 to be saved in PNG format.
SnpScheduleTask.jsx Shows how to schedule a task in Bridge.
SnpSendArray.jsx Shows how to pass an array from Adobe Photoshop CS5 to Bridge CS5 in response to a BridgeTalk message.
SnpSendCustomObject.jsx Shows how to pass a custom JavaScript object from Adobe Bridge CS5 to another application (Adobe Photoshop CS5) in a BridgeTalk message, and pass it back in a response.
SnpSendDOMObject.jsx Shows how to pass a scripting DOM object from Adobe Photoshop CS5 to Bridge CS5 in a BridgeTalk message.
SnpSendMessage.jsx Demonstrates basic cross-application communication using BridgeTalk messages, between Bridge CS5 and Photoshop CS5.
SnpSendMessageToInDesign.jsx Demonstrates basic cross-application communication using BridgeTalk messages, communicating between Bridge CS5 and InDesign CS5.
SnpTemplate.jsx The template for writing snippets.

AdobeBridgeCS5SDK

http://www.adobe.com/devnet/bridge
Documentation generated by JSDoc on Tue Apr 27 10:21:34 2010