Adobe 65009963 Scripting Guide - Page 9

More resources to learn scripting, JavaScript variables, JavaScript keywords and statement syntax - pdf

Page 9 highlights

Overview More resources to learn scripting 9 Additionally, After Effects includes a JavaScript debugger. For more information on activating and using the debugger, see the ExtendScript Toolkit documentation in the JavaScript Tools Guide. More resources to learn scripting Many resources exist for learning more about scripting that uses the ECMA standard. The After Effects scripting engine supports the 3rd Edition of the ECMA-262 Standard, including its notational and lexical conventions, types, objects, expressions, and statements. For a complete listing of the keywords and operators included with ECMAScript, refer to ECMA-262.pdf, available at ww w. ecma -in tern atio nal .o rg/pu blicatio ns/stan dard s/Ecm a-262 .ht m . Books that deal with JavaScript 1.2 are also useful for understanding how scripting works in After Effects. One book that is something of a standard for JavaScript users is JavaScript: The Definitive Guide (O'Reilly) by David Flanagan. Another very readable source is JavaScript: A Beginner's Guide (Osborne) by John Pollock. Both of these texts contain information that pertains only to extensions of JavaScript for Internet browsers; however, they also contain thorough descriptions of scripting fundamentals. There are also books for using AppleScript and creating Windows command line scripts, each of which can be used to send scripts to After Effects. JavaScript variables Scripting shares a global environment, so any script executed at startup can define variables and functions that are available to all scripts. In all cases, variables and functions, once defined by running a script that contains them, persist in subsequent scripts during a given After Effects session. Once the application is quit, all such globally defined variables and functions are cleared. Scripters should be careful about giving variables in scripts unique names, so that a script does not inadvertently reassign global variables intended to persist throughout a session. JavaScript keywords and statement syntax Although it is not possible to provide an exhaustive resource describing usage of JavaScript, the following tables provide an overview of keywords, statements, operators, precedence, and associativity. The following table lists and describes all keywords and statements recognized by the After Effects scripting engine. Table 1 Keywords and Statement Syntax Keyword/Statement Description break Standard JavaScript; exit the currently executing loop. continue Standard JavaScript; cease execution of the current loop iteration. case Label used in a s w i t c h statement. default Label used in a s w i t c h statement when a c a s e label is not found. do...while Standard JavaScript construct. Similar to the w h i l e loop, except loop condition evaluation occurs at the end of the loop. false Literal representing the boolean false value. for Standard JavaScript loop construct. for...in Standard JavaScript construct. Provides a way to easily loop through the properties of an object. 9

  • 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
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193

9
Overview
More resources to learn scripting
9
Additionally, After Effects includes a JavaScript debugger. For more information on activating and using the
debugger, see the ExtendScript Toolkit documentation in the
JavaScript Tools Guide
.
More resources to learn scripting
Many resources exist for learning more about scripting that uses the ECMA standard.
The After Effects scripting engine supports the 3rd Edition of the ECMA-262 Standard, including its
notational and lexical conventions, types, objects, expressions, and statements.
For a complete listing of the keywords and operators included with ECMAScript, refer to ECMA-262.pdf,
available at
www.ecma-international.org/publications/standards/Ecma-262.htm
.
Books that deal with JavaScript 1.2 are also useful for understanding how scripting works in After Effects. One
book that is something of a standard for JavaScript users is
JavaScript: The Definitive Guide
(O’Reilly) by David
Flanagan. Another very readable source is
JavaScript: A Beginner’s Guide
(Osborne) by John Pollock. Both of
these texts contain information that pertains only to extensions of JavaScript for Internet browsers; however,
they also contain thorough descriptions of scripting fundamentals.
There are also books for using AppleScript and creating Windows command line scripts, each of which can be
used to send scripts to After Effects.
JavaScript variables
Scripting shares a global environment, so any script executed at startup can define variables and functions that
are available to all scripts. In all cases, variables and functions, once defined by running a script that contains
them, persist in subsequent scripts during a given After Effects session. Once the application is quit, all such
globally defined variables and functions are cleared. Scripters should be careful about giving variables in
scripts unique names, so that a script does not inadvertently reassign global variables intended to persist
throughout a session.
JavaScript keywords and statement syntax
Although it is not possible to provide an exhaustive resource describing usage of JavaScript, the following
tables provide an overview of keywords, statements, operators, precedence, and associativity.
The following table lists and describes all keywords and statements recognized by the After Effects scripting
engine.
Table 1
Keywords and Statement Syntax
Keyword/Statement
Description
break
Standard JavaScript; exit the currently executing loop.
continue
Standard JavaScript; cease execution of the current loop iteration.
case
Label used in a
switch
statement.
default
Label used in a
switch
statement when a
case
label is not found.
do...while
Standard JavaScript construct. Similar to the
while
loop, except loop condition evaluation occurs
at the end of the loop.
false
Literal representing the boolean false value.
for
Standard JavaScript loop construct.
for...in
Standard JavaScript construct. Provides a way to easily loop through the properties of an object.