beautypg.com

Bridgetalk.bringtofront(), Bridgetalk.send() – Adobe Dreamweaver API Reference CS5 User Manual

Page 125

background image

120

DREAMWEAVER API REFERENCE

Application

Last updated 8/27/2013

BridgeTalk.bringToFront()

Availability
Dreamweaver CS3.

Description
Makes the specified application the frontmost process, by calling the

BridgeTalk::bringToFront()

function.

Arguments
applicationID

The applicationID argument is a string, such as

bridge

or

dreamweaver

, that specifies the application to activate.

Returns
Nothing

Example
This example shows how Dreamweaver implements the

browseInBridge()

function. First, you create a BridgeTalk

instance, then the two most important properties are set:

target

and

body

.

is the target application. In this

case it is the Bridge application. It's identifier is

bridge

.

is the message to send. Usually

is a script that

the target application can understand and execute after it is received. The

send()

function is called to send the

to the

.

if (!JSBridge.isRunning('bridge'))

{
var bt = new BridgeTalk;
var scriptSavePath = browsePath.replace(/['"\\]/g, "\$&");
var script = "app.document.thumbnail = new Thumbnail(decodeURI('" + scriptSavePath + "'));";

// Send the script to bridge and give it 10 sec to launch before assuming an error.

bt.target = "bridge";
bt.body = script;
result = bt.send(10);
}

if (result)

BridgeTalk.bringToFront('bridge');

Bridgetalk.send()

Availability
Dreamweaver CS3.

Description
Establishes communications with the Bridge application.

Arguments:
timeout

The

timeout

argument is an optional attribute that sets the time out interval in seconds.