Copy link to clipboard
Copied
In the latest After Effects Beta, you can now access source item timecode via scripting through a new frameTime attribute. This will enable you to specify a particular frame, so you don't need to worry about precision limitations due to floating point rounding that you may have encountered accessing time in seconds. You can set frameTime as far back as 3 hours before the 0:00:00:00 time and as far forward as 1 frame less than 24:00:00:00. Compositions can be a maximum 3 hours in length; these limits exist so you can slide layers that far back or forward.
A couple usage examples:
Get the current frame time with
var curFrame = app.project.item(1).frameTime;
Set the current frame time with
app.project.item(1).frameTime = 105;
frameTime is an AVItem attribute, so app.project.item(1) can be replaced with any reference that resolves to one of those. Please give it a try and let us know how it’s working for you.
Have something to add?