Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aescripts/e7ec62ebad9cbac2155de58691f6a431 to your computer and use it in GitHub Desktop.
Save aescripts/e7ec62ebad9cbac2155de58691f6a431 to your computer and use it in GitHub Desktop.
#AfterEffects #Script #KBar Moves the active comp's current time indicator by the defined amount
/*
Move by a predefined number of frames in the timeline.jsx
Moves the active comp's current time indicator by the defined amount
*/
try{
var framesToMove = -5; //make this a negative to move backwards
app.project.activeItem.time = app.project.activeItem.time + framesToMove * app.project.activeItem.frameDuration;
}
catch (e) {}
@ultrachroma
Copy link

How can this be modified to move by fractions of a second instead of number of frames? E.g.:

comp FPS = 24 then 0.5 sec = 12 frames;
comp FPS = 30 then 0.5 sec = 15 frames;
etc.

Thanks in advance!

@aescripts
Copy link
Author

How can this be modified to move by fractions of a second instead of number of frames?

Remove the multiplication by the frameDuration:

var timeToMove = -5;  //in seconds
app.project.activeItem.time = app.project.activeItem.time + timeToMove;

@ultrachroma
Copy link

Excellent . . . and so simple. Thanks! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment