-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathISO_WorkAreaStartToSpecificFrame.jsx
More file actions
53 lines (41 loc) · 1.46 KB
/
Copy pathISO_WorkAreaStartToSpecificFrame.jsx
File metadata and controls
53 lines (41 loc) · 1.46 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
// ISO_WorkAreaStartToSpecificFrame.jsx
// Artist: https://www.jasonfletcher.info/
// Code generated by ChatGPT-5
// Date: October 9, 2025
// Description: This After Effects script will move the "Work Area Start" to a user-defined frame for all selected comps in the Project window.
(function moveWorkAreaStartToUserFrame() {
app.beginUndoGroup("Move Work Area Start to User Frame");
var items = app.project.selection;
var movedCount = 0;
if (items.length === 0) {
alert("Please select one or more compositions in the Project panel.");
app.endUndoGroup();
return;
}
// Ask user ONCE for desired frame
var input = prompt("Enter the frame number to move the Work Area Start to:", "5");
if (input === null) {
app.endUndoGroup();
return; // user cancelled
}
var targetFrame = parseInt(input, 10);
if (isNaN(targetFrame) || targetFrame < 0) {
alert("Invalid frame number entered.");
app.endUndoGroup();
return;
}
for (var i = 0; i < items.length; i++) {
var comp = items[i];
if (comp instanceof CompItem) {
var frameDuration = 1 / comp.frameRate;
var targetTime = frameDuration * targetFrame;
comp.workAreaStart = targetTime;
movedCount++;
}
}
alert(
"Comps processed: " + movedCount + "\n" +
"Work Area Start set to frame: " + targetFrame
);
app.endUndoGroup();
})();