17
JavaScript Reference
Global functions
17
Returns
Floating-point value, the number of seconds.
timeToCurrentFormat() global function
t im e T o C u r r e n t F o r m a t (
t i m e , f p s , i s D u r a t i o n
)
Description
Converts a numeric time value (a number of seconds) to a frame time value; that is, a formatted string that
shows which frame corresponds to that time, at the specified rate. For example, if the time is 0.5 seconds, and
the frame rate is 24 fps, the frame would be 0:00:12 (when the project is set to Display Timecode). If the frame
rate is 30 fps, the frame would be 0:00:15. The format of the timecode string is determined by a project setting.
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
Returns
String in the project’s current time display format.
write() global function
w r i t e (
t e x t
)
Description
Writes output to the Info panel, with no line break added.
Parameters
Returns
Nothing.
Example
w r i t e ( " T h i s t e x t a p p e a r s i n I n f o p a n e l " ) ;
w r i t e ( " w i t h m o r e o n s a m e l i n e . " ) ;
f p s
The frames-per-second, a floating-point value.
i s D u r a t i o n
Optional. When true, the time is a duration (measured from frame 0). When false (the default), the time is
measured from the project’s starting frame.
t i m e
The number of seconds, a floating-point value.
f p s
The frames-per-second, a floating-point value.
i s D u r a t i o n
Optional. When true, the time is a duration (measured from frame 0). When false (the default), the time is
measured from the project’s starting frame.
t e x t
The string to display. Truncated if too long for the Info panel.
Summary of Contents for 65009963 - After Effects CS4
Page 1: ...SCRIPTING GUIDE...