Adobe 65009963 Scripting Guide - Page 16

Global functions, clearOutput() global function, currentFormatToTime() global function

Page 16 highlights

JavaScript Reference Global functions 16 Global functions These globally available functions that are specific to After Effects. Any JavaScript object or function can call these functions, which allow you to display text in a small (3-line) area of the Info panel, and to convert numeric time values to and from string values. Global function clearOutput() currentFormatToTime() timeToCurrentFormat() write() writeLn() Description Clears text from the Info panel. Converts string time value to a numeric time value. Converts a numeric time value to a string time value. Writes text to the Info panel, with no line break added. Writes text to the Info panel, adding a line break at the end. Additional global functions for standard user I/O (alert, confirm, and prompt) and static functions for file I/O, are defined by ExtendScript; for detailed reference information, see the Adobe Bridge® JavaScript Reference. NOTE: The After Effects global functions for standard dialogs and file I/O are still supported in this release, but are deprecated and will not be supported in future releases. For details, see the After Effects 6.5 documentation. clearOutput() global function clearOutput() Description Clears the output in the Info panel. Parameters None. Returns Nothing. currentFormatToTime() global function currentFormatToTime(formattedTime, fps, isDuration) Description Converts a formatted string for a frame time value to a number of seconds, given a specified frame rate. For example, if the formatted frame time value is 0:00:12 (the exact string format is determined by a project setting), and the frame rate is 24 fps, the time would be 0.5 seconds (12/24). If the frame rate is 30 fps, the time would be 0.4 seconds (12/30). If the time is a duration, the frames are counted from 0. Otherwise, the frames are counted from the project's starting frame (see "Project displayStartFrame attribute" on page 111). Parameters f o r m a t t e d T i m e The frame time value, a string specifying a number of frames in the project's current time display format. 16

  • 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

16
JavaScript Reference
Global functions
16
Global functions
These globally available functions that are specific to After Effects. Any JavaScript object or function can call
these functions, which allow you to display text in a small (3-line) area of the Info panel, and to convert
numeric time values to and from string values.
Additional global functions for standard user I/O (
alert
,
confirm
, and
prompt
) and static functions for file
I/O, are defined by ExtendScript; for detailed reference information, see the
Adobe Bridge
®
JavaScript
Reference
.
NOTE: The After Effects global functions for standard dialogs and file I/O are still supported in this release, but
are deprecated and will not be supported in future releases. For details, see the After Effects 6.5 documentation.
clearOutput() global function
clearOutput()
Description
Clears the output in the Info panel.
Parameters
None.
Returns
Nothing.
currentFormatToTime() global function
currentFormatToTime(
formattedTime, fps, isDuration
)
Description
Converts a formatted string for a frame time value to a number of seconds, given a specified frame rate. For
example, if the formatted frame time value is 0:00:12 (the exact string format is determined by a project
setting), and the frame rate is 24 fps, the time would be 0.5 seconds (12/24). If the frame rate is 30 fps, the time
would be 0.4 seconds (12/30).
If the time is a duration, the frames are counted from 0. Otherwise, the frames are counted from the project’s
starting frame (see “Project displayStartFrame attribute” on page 111).
Parameters
Global function
Description
clearOutput()
Clears text from the Info panel.
currentFormatToTime()
Converts string time value to a numeric time value.
timeToCurrentFormat()
Converts a numeric time value to a string time value.
write()
Writes text to the Info panel, with no line break added.
writeLn()
Writes text to the Info panel, adding a line break at the end.
formattedTime
The frame time value, a string specifying a number of frames in the project’s current time display format.