Adobe 65009333 Scripting Guide - Page 55

User Interfaces, Dialog-box overview

Page 55 highlights

5 User Interfaces JavaScript can create dialog boxes for simple yes/no questions and text entry, but you probably will need to create more complex dialog boxes for your scripts. InCopy scripting can add dialog boxes and can populate them with common user-interface controls, like pop-up lists, text-entry fields, and numeric-entry fields. If you want your script to collect and act on information entered by you or any other user of your script, use the dialog object. This chapter shows how to work with InCopy dialog scripting. The sample scripts in this chapter are presented in order of complexity, starting with very simple scripts and building toward more complex operations. NOTE: InCopy scripts written in JavaScript also can include user interfaces created using the Adobe ScriptUI component. This chapter includes some ScriptUI scripting tutorials; for more information, see Adobe Creative Suite® 3 JavaScript Tools Guide. We assume you have already read Chapter 2, "Getting Started" and know how to create, install, and run a script. Dialog-box overview An InCopy dialog box is an object like any other InCopy scripting object. The dialog box can contain several different types of elements (known collectively as "widgets"), as shown in the following figure: dialog dialog column static text border panel checkbox control radiobutton group radiobutton control measurement editbox dropdown The items in the figure are defined in the following table: 55

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88

55
5
User Interfaces
JavaScript can create dialog boxes for simple yes/no questions and text entry, but you probably will need
to create more complex dialog boxes for your scripts. InCopy scripting can add dialog boxes and can
populate them with common user-interface controls, like pop-up lists, text-entry fields, and numeric-entry
fields. If you want your script to collect and act on information entered by you or any other user of your
script, use the
dialog
object.
This chapter shows how to work with InCopy dialog scripting. The sample scripts in this chapter are
presented in order of complexity, starting with very simple scripts and building toward more complex
operations.
N
OTE
:
InCopy scripts written in JavaScript also can include user interfaces created using the Adobe
ScriptUI
component. This chapter includes some ScriptUI scripting tutorials; for more information, see
Adobe
Creative Suite
®
3 JavaScript Tools Guide
.
We assume you have already read
Chapter 2, “
Getting Started
and know how to create, install, and run a
script.
Dialog-box overview
An InCopy dialog box is an object like any other InCopy scripting object. The dialog box can contain
several different types of elements (known collectively as “widgets”), as shown in the following figure:
The items in the figure are defined in the following table:
dialog
dialog column
border panel
checkbox control
radiobutton group
radiobutton control
static text
measurement editbox
dropdown