Adobe 27510753 Scripting Guide - Page 58

Debugging in the Toolkit, Syntax checking, Evaluation in help tips

Page 58 highlights

50 Using ExtendScript Tools and Features Adobe InDesign CS2 Scripting Guide Right arrow Up arrow Down arrow Page up Page down Ctrl + Up arrow Ctrl + Down arrow Ctrl + Page up Ctrl + page down Ctrl + Left arrow Ctrl + right arrow Home End Ctrl + Home Ctrl + End Move insertion point right one character Move insertion point up one line; stay in column if possible Move insertion point down one line; stay in column if possible Move insertion point one page up Move insertion point one page down Scroll up one line without moving the insertion point Scroll down one line without moving the insertion point Scroll one page up without moving the insertion point Scroll one page down without moving the insertion point Move insertion point one word to the left Move insertion point one word to the right Move insertion point to start of line Move insertion point to end of line Move insertion point to start of text Move insertion point to end of text The editor supports extended keyboard input via IME (Windows) or TMS (Mac OS). This is especially important for Far Eastern characters. Syntax checking Before running the new script or saving the text as a script file, you can check whether the text contains JavaScript syntax errors. Choose Check Syntax from the Edit menu or from the Editor's right-click context menu. l If the script is syntactically correct, the status line shows "No syntax errors". l If the Toolkit finds a syntax error, such as a missing quote, it highlights the affected text, plays a sound, and shows the error message in the status line so you can fix the error. Debugging in the Toolkit You can debug the code in the currently active Editor tab. Select one of the debugging commands to either run or to single-step through the program. When you run code from the Editor, it runs in the current target application's selected JavaScript engine. The Toolkit itself runs an independent JavaScript engine, so you can quickly edit and run a script without connecting to a target application. Evaluation in help tips If you let your mouse pointer rest over a variable or function in an Editor tab, the result of evaluating that variable or function is displayed as a help tip. When you are not debugging the program, this is helpful only if

  • 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
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184

50
Using ExtendScript Tools and Features
Adobe InDesign CS2 Scripting Guide
Right arrow
Move insertion point right one character
Up arrow
Move insertion point up one line; stay in column if possible
Down arrow
Move insertion point down one line; stay in column if possible
Page up
Move insertion point one page up
Page down
Move insertion point one page down
Ctrl + Up arrow
Scroll up one line without moving the insertion point
Ctrl + Down arrow
Scroll down one line without moving the insertion point
Ctrl + Page up
Scroll one page up without moving the insertion point
Ctrl + page down
Scroll one page down without moving the insertion point
Ctrl + Left arrow
Move insertion point one word to the left
Ctrl + right arrow
Move insertion point one word to the right
Home
Move insertion point to start of line
End
Move insertion point to end of line
Ctrl + Home
Move insertion point to start of text
Ctrl + End
Move insertion point to end of text
The editor supports extended keyboard input via IME (Windows) or TMS (Mac OS). This is especially important
for Far Eastern characters.
Syntax checking
Before running the new script or saving the text as a script file, you can check whether the text contains
JavaScript syntax errors. Choose Check Syntax from the Edit
menu or from the Editor’s right-click context
menu.
If the script is syntactically correct, the status line shows "No syntax errors".
If the Toolkit finds a syntax error, such as a missing quote, it highlights the affected text, plays a sound, and
shows the error message in the status line so you can fix the error.
Debugging in the Toolkit
You can debug the code in the currently active Editor tab. Select one of the debugging commands to either
run or to single-step through the program.
When you run code from the Editor, it runs in the current target application’s selected JavaScript engine.
The Toolkit itself runs an independent JavaScript engine, so you can quickly edit and run a script without
connecting to a target application.
Evaluation in help tips
If you let your mouse pointer rest over a variable or function in an Editor tab, the result of evaluating that
variable or function is displayed as a help tip. When you are not debugging the program, this is helpful only if
l
l