-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathISO_MoveTimeIndicatorFrames.jsx
More file actions
63 lines (46 loc) · 1.91 KB
/
Copy pathISO_MoveTimeIndicatorFrames.jsx
File metadata and controls
63 lines (46 loc) · 1.91 KB
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
// ISO_MoveTimeIndicatorFrames.jsx
// Artist: https://www.jasonfletcher.info/
// Code generated by ChatGPT-5.3
// Date: March 15, 2026
// Description: This After Effects script will open the selected comps in the Project window and move the Current Time Indicator to a user-specified frame.
{
// Ask user for frame number
var userInput = prompt("Move CTI to which frame?", "20");
if (userInput !== null) {
var targetFrame = parseInt(userInput, 10);
if (!isNaN(targetFrame) && targetFrame >= 0) {
// Start undo group
app.beginUndoGroup("Move CTI to Frame " + targetFrame);
// Get selected items
var selectedItems = app.project.selection;
if (selectedItems.length === 0) {
alert("Please select at least one composition in the Project panel.");
app.endUndoGroup();
} else {
var affectedComps = 0;
for (var i = 0; i < selectedItems.length; i++) {
var item = selectedItems[i];
// Only operate on compositions
if (item instanceof CompItem) {
// Convert frame → seconds
var targetTime = targetFrame * item.frameDuration;
// Open comp in viewer
item.openInViewer();
// Move CTI
item.time = targetTime;
affectedComps++;
}
}
// End undo group
app.endUndoGroup();
// Final summary alert
alert(
"Target frame set: " + targetFrame + "\n" +
"Comps affected: " + affectedComps
);
}
} else {
alert("Please enter a valid non-negative frame number.");
}
}
}