Class SnpSendDOMObject
Object
|
+--SnpSendDOMObject
- class
SnpSendDOMObject
Shows how to pass a scripting DOM object from Adobe Photoshop CS5 to Bridge CS5
in a BridgeTalk message.
Usage
- Make sure Adobe Bridge CS5 and Adobe Photoshop CS5 are running
- Run the snippet in the ExtendScript Toolkit,
with Bridge CS5 as the target (see Readme.txt)
- Inspect the JavaScript Console in the Toolkit to see information about the messages and objects passed between the applications.
- Note; there is no other visible output besides the trace to the JavaScript Console of the ESTK.
Description
Demonstrates passing a DOM object from Adobe Photoshop CS5 to Adobe Bridge CS5 via BridgeTalk.
The passed script within the BridgeTalk message creates a File instance and then serialises
it with toSource(). When Bridge receives the BridgeTalk message response, it can access the DOM object
created by Adobe Photoshop and its properties by using eval() on the 'resObj.body' which is
returned to the callback function BridgeTalk.onResult().
Defined in SnpSendDOMObject.jsx
Field Summary |
String |
requiredContext
The context in which this snippet can run. |
Method Summary |
Boolean
|
canRun()
Determines whether snippet can run given current context.
|
Boolean
|
run()
Functional part of this snippet.
|
requiredContext
String requiredContext
The context in which this snippet can run.
SnpSendDOMObject
SnpSendDOMObject()
canRun
Boolean canRun()
Determines whether snippet can run given current context. The snippet
fails if these preconditions are not met:
- Must run in Bridge
- Photoshop must be running
Returns:
True if this snippet can run, false otherwise
run
Boolean run()
Functional part of this snippet.
Constructs a BridgeTalk message, which contains both the script to
run in Photoshop, and the onResult callback for processing the response,
then sends the message to Photoshop.
The script creates a DOM object on the target side, and serializes it
in order to return it as the result of evaluation.
Returns:
True if the snippet ran as expected, false if Photoshop or Bridge is not running or if an error occurred sending the message.
http://www.adobe.com/devnet/bridge
Documentation generated by
JSDoc on Tue Apr 27 10:21:34 2010