Your First Incopy Dialog Box - Adobe 65009333 - InCopy CS4 - PC Manual

Scripting guide: javascript
Hide thumbs Also See for 65009333 - InCopy CS4 - PC:
Table of Contents

Advertisement

User Interfaces
Dialog-box element
Text-edit fields
Numeric-entry fields
Pop-up menus
Control that combines a text-edit field with a
pop-up menu
Check box
Radio buttons
The
dialog
object.
dialogColumns
dialogColumns
(both of which can, if necessary, contain more
Like any other InCopy scripting object, each part of a dialog box has its own properties. For example, a
checkboxControl
(
checkedState
appears on the control's menu.
To use a dialog box in your script, create the
dialog box, and then gather values from the dialog-box controls to use in your script. Dialog boxes remain
in InCopy's memory until they are destroyed. This means you can keep a dialog box in memory and have
data stored in its properties used by multiple scripts, but it also means the dialog boxes take up memory
and should be disposed of when they are not in use. In general, you should destroy a dialog-box object
before your script finishes executing.

Your first InCopy dialog box

The process of creating an InCopy dialog box is very simple: add a dialog box, add a dialog column to the
dialog box, and add controls to the dialog column. The following script demonstrates the process (for the
complete script, see SimpleDialog).
var myDialog = app.dialogs.add({name:"Simple Dialog"});
//Add a dialog column.
with(myDialog.dialogColumns.add()){
staticTexts.add({staticLabel:"This is a very simple dialog box."});
}
//Show the dialog box.
var myResult = myDialog.show();
//Display a message.
if(myResult == true){
alert("You clicked the OK button.");
}
else{
alert("You clicked the Cancel button.");
}
//Remove the dialog box from memory.
myDialog.destroy();
object itself does not directly contain the controls; that is the purpose of the
give you a way to control the positioning of controls within a dialog box. Inside
, you can further subdivide the dialog box into other
has a property for its text (
). The
control has a property (
dropdown
InCopy name
Text editbox control
Real editbox, integer editbox, measurement
editbox, percent editbox, angle editbox
Drop-down control
Combo-box control
Check-box control
Radio-button control
and
dialogColumns
) and another property for its state
staticLabel
stringList
object, populate it with various controls, display the
dialog
Your first InCopy dialog box 56
dialogColumn
or
dialogColumns
borderPanels
).
borderPanels
) for setting the list of options that

Advertisement

Table of Contents
loading

This manual is also suitable for:

Incopy cs4

Table of Contents