@synthetic-ai/premiere-mcp 2.2.0 → 2.3.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +135 -135
  2. package/LICENSE +21 -21
  3. package/README.md +242 -242
  4. package/cep-plugin/.debug +8 -8
  5. package/cep-plugin/CSInterface.js +92 -92
  6. package/cep-plugin/host.jsx +7 -7
  7. package/cep-plugin/index.html +472 -472
  8. package/cep-plugin/main.js +6 -0
  9. package/cep-plugin/premiere.jsx +24947 -24947
  10. package/dist/bridge/script-builder.js +378 -378
  11. package/dist/license.js +38 -0
  12. package/dist/server.js +60 -60
  13. package/dist/tools/advanced.js +357 -357
  14. package/dist/tools/audio-advanced.js +1049 -1049
  15. package/dist/tools/audio.js +42 -42
  16. package/dist/tools/captions.js +27 -27
  17. package/dist/tools/clipboard.js +214 -214
  18. package/dist/tools/color-advanced.js +253 -253
  19. package/dist/tools/discovery.js +291 -291
  20. package/dist/tools/effects.js +285 -285
  21. package/dist/tools/export-presets.js +206 -206
  22. package/dist/tools/export.js +255 -255
  23. package/dist/tools/health.js +10 -10
  24. package/dist/tools/inspection.js +885 -885
  25. package/dist/tools/keyframes.js +369 -369
  26. package/dist/tools/markers.js +89 -89
  27. package/dist/tools/media.js +178 -178
  28. package/dist/tools/metadata.js +94 -94
  29. package/dist/tools/multicam.js +50 -50
  30. package/dist/tools/playback.js +15 -15
  31. package/dist/tools/playhead.js +95 -95
  32. package/dist/tools/project-manager.js +21 -21
  33. package/dist/tools/project.js +149 -149
  34. package/dist/tools/scripting.js +319 -319
  35. package/dist/tools/selection.js +202 -202
  36. package/dist/tools/sequence-advanced.js +379 -379
  37. package/dist/tools/sequence-settings.js +564 -564
  38. package/dist/tools/sequence.js +167 -167
  39. package/dist/tools/source-monitor.js +68 -68
  40. package/dist/tools/text.js +58 -58
  41. package/dist/tools/timeline.js +312 -312
  42. package/dist/tools/track-management.js +446 -446
  43. package/dist/tools/track-targeting.js +635 -635
  44. package/dist/tools/tracks.js +87 -87
  45. package/dist/tools/transitions-motion.js +174 -174
  46. package/dist/tools/transitions.js +111 -111
  47. package/dist/tools/utility.js +606 -606
  48. package/dist/tools/workspace.js +29 -29
  49. package/package.json +66 -66
  50. package/scripts/build-chat-dmg.sh +210 -210
  51. package/scripts/build-chat-zip.sh +291 -291
  52. package/scripts/install-cep-windows.ps1 +99 -99
  53. package/scripts/install-cep.sh +66 -66
  54. package/scripts/install-chat-plugin.bat +67 -67
  55. package/scripts/install-chat-plugin.sh +85 -85
  56. package/scripts/install-windows.bat +95 -95
  57. package/scripts/package.mjs +254 -254
@@ -13,31 +13,31 @@ export function getSequenceSettingsTools(bridgeOptions) {
13
13
  },
14
14
  handler: async (args) => {
15
15
  const seqIndex = args.sequence_index ?? 0;
16
- const script = buildToolScript(`
17
- var seq = app.project.sequences[${seqIndex}];
18
- if (!seq) return __error("Sequence index ${seqIndex} not found");
19
- var settings = seq.getSettings();
20
- var fps = 0;
21
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
22
- var frticks = parseFloat(settings.videoFrameRate.ticks);
23
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
24
- }
25
- return __result({
26
- name: seq.name,
27
- sequenceID: seq.sequenceID,
28
- width: settings ? settings.videoFrameWidth : 0,
29
- height: settings ? settings.videoFrameHeight : 0,
30
- frameRate: fps,
31
- frameRateTicks: settings && settings.videoFrameRate ? settings.videoFrameRate.ticks : "0",
32
- sampleRate: settings ? settings.audioSampleRate : 0,
33
- displayFormat: settings ? settings.videoDisplayFormat : 0,
34
- audioDisplayFormat: settings ? settings.audioDisplayFormat : 0,
35
- previewFileFormat: settings ? settings.videoPreviewFileFormat : "",
36
- previewCodec: settings ? settings.videoPreviewCodec : "",
37
- maximumBitDepth: settings ? settings.videoMaximumBitDepth : false,
38
- maximumRenderQuality: settings ? settings.videoMaximumRenderQuality : false,
39
- compositeLinearColor: settings ? settings.videoCompositeLinearColor : false
40
- });
16
+ const script = buildToolScript(`
17
+ var seq = app.project.sequences[${seqIndex}];
18
+ if (!seq) return __error("Sequence index ${seqIndex} not found");
19
+ var settings = seq.getSettings();
20
+ var fps = 0;
21
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
22
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
23
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
24
+ }
25
+ return __result({
26
+ name: seq.name,
27
+ sequenceID: seq.sequenceID,
28
+ width: settings ? settings.videoFrameWidth : 0,
29
+ height: settings ? settings.videoFrameHeight : 0,
30
+ frameRate: fps,
31
+ frameRateTicks: settings && settings.videoFrameRate ? settings.videoFrameRate.ticks : "0",
32
+ sampleRate: settings ? settings.audioSampleRate : 0,
33
+ displayFormat: settings ? settings.videoDisplayFormat : 0,
34
+ audioDisplayFormat: settings ? settings.audioDisplayFormat : 0,
35
+ previewFileFormat: settings ? settings.videoPreviewFileFormat : "",
36
+ previewCodec: settings ? settings.videoPreviewCodec : "",
37
+ maximumBitDepth: settings ? settings.videoMaximumBitDepth : false,
38
+ maximumRenderQuality: settings ? settings.videoMaximumRenderQuality : false,
39
+ compositeLinearColor: settings ? settings.videoCompositeLinearColor : false
40
+ });
41
41
  `);
42
42
  return sendCommand(script, bridgeOptions);
43
43
  },
@@ -63,23 +63,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
63
63
  const frameRate = args.frame_rate !== undefined ? args.frame_rate : -1;
64
64
  const sampleRate = args.sample_rate !== undefined ? args.sample_rate : -1;
65
65
  const displayFormat = args.display_format !== undefined ? args.display_format : -1;
66
- const script = buildToolScript(`
67
- var seq = app.project.sequences[${seqIndex}];
68
- if (!seq) return __error("Sequence index ${seqIndex} not found");
69
- var settings = seq.getSettings();
70
- if (!settings) return __error("Could not get sequence settings");
71
- var changed = [];
72
- if (${width} !== -1) { settings.videoFrameWidth = ${width}; changed.push("width"); }
73
- if (${height} !== -1) { settings.videoFrameHeight = ${height}; changed.push("height"); }
74
- if (${frameRate} !== -1) {
75
- var ticks = Math.round(TICKS_PER_SECOND / ${frameRate});
76
- settings.videoFrameRate.ticks = String(ticks);
77
- changed.push("frameRate");
78
- }
79
- if (${sampleRate} !== -1) { settings.audioSampleRate = ${sampleRate}; changed.push("sampleRate"); }
80
- if (${displayFormat} !== -1) { settings.videoDisplayFormat = ${displayFormat}; changed.push("displayFormat"); }
81
- seq.setSettings(settings);
82
- return __result({ success: true, changed: changed });
66
+ const script = buildToolScript(`
67
+ var seq = app.project.sequences[${seqIndex}];
68
+ if (!seq) return __error("Sequence index ${seqIndex} not found");
69
+ var settings = seq.getSettings();
70
+ if (!settings) return __error("Could not get sequence settings");
71
+ var changed = [];
72
+ if (${width} !== -1) { settings.videoFrameWidth = ${width}; changed.push("width"); }
73
+ if (${height} !== -1) { settings.videoFrameHeight = ${height}; changed.push("height"); }
74
+ if (${frameRate} !== -1) {
75
+ var ticks = Math.round(TICKS_PER_SECOND / ${frameRate});
76
+ settings.videoFrameRate.ticks = String(ticks);
77
+ changed.push("frameRate");
78
+ }
79
+ if (${sampleRate} !== -1) { settings.audioSampleRate = ${sampleRate}; changed.push("sampleRate"); }
80
+ if (${displayFormat} !== -1) { settings.videoDisplayFormat = ${displayFormat}; changed.push("displayFormat"); }
81
+ seq.setSettings(settings);
82
+ return __result({ success: true, changed: changed });
83
83
  `);
84
84
  return sendCommand(script, bridgeOptions);
85
85
  },
@@ -92,36 +92,36 @@ export function getSequenceSettingsTools(bridgeOptions) {
92
92
  required: [],
93
93
  },
94
94
  handler: async (_args) => {
95
- const script = buildToolScript(`
96
- var seq = app.project.activeSequence;
97
- if (!seq) return __error("No active sequence");
98
- var settings = seq.getSettings();
99
- var info = { sequenceName: seq.name };
100
- var found = false;
101
- // The correct property for color space is videoColorSpace (NOT videoDisplayFormat,
102
- // which is the TIMECODE display format). Read from settings first, then the sequence.
103
- try {
104
- if (settings && settings.videoColorSpace !== undefined && settings.videoColorSpace !== null) {
105
- info.videoColorSpace = settings.videoColorSpace;
106
- found = true;
107
- }
108
- } catch(eSettings) {}
109
- if (!found) {
110
- try {
111
- if (seq.videoColorSpace !== undefined && seq.videoColorSpace !== null) {
112
- info.videoColorSpace = seq.videoColorSpace;
113
- found = true;
114
- }
115
- } catch(eSeq) {}
116
- }
117
- if (!found) {
118
- info.videoColorSpace = "unknown";
119
- info.note = "videoColorSpace property is not available in this Premiere Pro version. Set color space via Sequence > Sequence Settings > Working Color Space in the UI.";
120
- }
121
- if (seq.getWorkArea) {
122
- try { info.workAreaType = seq.getWorkArea().type; } catch(e) {}
123
- }
124
- return __result(info);
95
+ const script = buildToolScript(`
96
+ var seq = app.project.activeSequence;
97
+ if (!seq) return __error("No active sequence");
98
+ var settings = seq.getSettings();
99
+ var info = { sequenceName: seq.name };
100
+ var found = false;
101
+ // The correct property for color space is videoColorSpace (NOT videoDisplayFormat,
102
+ // which is the TIMECODE display format). Read from settings first, then the sequence.
103
+ try {
104
+ if (settings && settings.videoColorSpace !== undefined && settings.videoColorSpace !== null) {
105
+ info.videoColorSpace = settings.videoColorSpace;
106
+ found = true;
107
+ }
108
+ } catch(eSettings) {}
109
+ if (!found) {
110
+ try {
111
+ if (seq.videoColorSpace !== undefined && seq.videoColorSpace !== null) {
112
+ info.videoColorSpace = seq.videoColorSpace;
113
+ found = true;
114
+ }
115
+ } catch(eSeq) {}
116
+ }
117
+ if (!found) {
118
+ info.videoColorSpace = "unknown";
119
+ info.note = "videoColorSpace property is not available in this Premiere Pro version. Set color space via Sequence > Sequence Settings > Working Color Space in the UI.";
120
+ }
121
+ if (seq.getWorkArea) {
122
+ try { info.workAreaType = seq.getWorkArea().type; } catch(e) {}
123
+ }
124
+ return __result(info);
125
125
  `);
126
126
  return sendCommand(script, bridgeOptions);
127
127
  },
@@ -137,23 +137,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
137
137
  },
138
138
  handler: async (args) => {
139
139
  const colorSpaceEsc = args.color_space.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
140
- const script = buildToolScript(`
141
- var seq = app.project.activeSequence;
142
- if (!seq) return __error("No active sequence");
143
- var settings = seq.getSettings();
144
- if (!settings) return __error("Could not get sequence settings");
145
- var requested = "${colorSpaceEsc}";
146
- // NOTE: Do NOT write settings.videoDisplayFormat here. That property is the
147
- // TIMECODE display format, not the color space, and setting it corrupts timecode.
148
- // The color space, when settable, lives on settings.videoColorSpace.
149
- try {
150
- if (settings.videoColorSpace !== undefined && settings.videoColorSpace !== null) {
151
- settings.videoColorSpace = requested;
152
- seq.setSettings(settings);
153
- return __result({ applied: requested, videoColorSpace: settings.videoColorSpace });
154
- }
155
- } catch(e) {}
156
- return __result({ note: "Color space is not directly settable via ExtendScript in this Premiere Pro version (videoColorSpace is unavailable). Set it via Sequence > Sequence Settings > Working Color Space in the UI.", requested: requested });
140
+ const script = buildToolScript(`
141
+ var seq = app.project.activeSequence;
142
+ if (!seq) return __error("No active sequence");
143
+ var settings = seq.getSettings();
144
+ if (!settings) return __error("Could not get sequence settings");
145
+ var requested = "${colorSpaceEsc}";
146
+ // NOTE: Do NOT write settings.videoDisplayFormat here. That property is the
147
+ // TIMECODE display format, not the color space, and setting it corrupts timecode.
148
+ // The color space, when settable, lives on settings.videoColorSpace.
149
+ try {
150
+ if (settings.videoColorSpace !== undefined && settings.videoColorSpace !== null) {
151
+ settings.videoColorSpace = requested;
152
+ seq.setSettings(settings);
153
+ return __result({ applied: requested, videoColorSpace: settings.videoColorSpace });
154
+ }
155
+ } catch(e) {}
156
+ return __result({ note: "Color space is not directly settable via ExtendScript in this Premiere Pro version (videoColorSpace is unavailable). Set it via Sequence > Sequence Settings > Working Color Space in the UI.", requested: requested });
157
157
  `);
158
158
  return sendCommand(script, bridgeOptions);
159
159
  },
@@ -166,25 +166,25 @@ export function getSequenceSettingsTools(bridgeOptions) {
166
166
  required: [],
167
167
  },
168
168
  handler: async (_args) => {
169
- const script = buildToolScript(`
170
- var seq = app.project.activeSequence;
171
- if (!seq) return __error("No active sequence");
172
- var settings = seq.getSettings();
173
- var fps = 25;
174
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
175
- var frticks = parseFloat(settings.videoFrameRate.ticks);
176
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
177
- }
178
- // seq.end is already a ticks STRING in PP (not a Time object — no .ticks)
179
- var endTicks = (seq.end != null) ? String(seq.end) : "0";
180
- var durationSecs = __ticksToSeconds(endTicks);
181
- var timecode = __ticksToTimecode(endTicks, fps);
182
- return __result({
183
- durationSeconds: durationSecs,
184
- timecode: timecode,
185
- frameRate: fps,
186
- endTicks: endTicks
187
- });
169
+ const script = buildToolScript(`
170
+ var seq = app.project.activeSequence;
171
+ if (!seq) return __error("No active sequence");
172
+ var settings = seq.getSettings();
173
+ var fps = 25;
174
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
175
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
176
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
177
+ }
178
+ // seq.end is already a ticks STRING in PP (not a Time object — no .ticks)
179
+ var endTicks = (seq.end != null) ? String(seq.end) : "0";
180
+ var durationSecs = __ticksToSeconds(endTicks);
181
+ var timecode = __ticksToTimecode(endTicks, fps);
182
+ return __result({
183
+ durationSeconds: durationSecs,
184
+ timecode: timecode,
185
+ frameRate: fps,
186
+ endTicks: endTicks
187
+ });
188
188
  `);
189
189
  return sendCommand(script, bridgeOptions);
190
190
  },
@@ -197,23 +197,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
197
197
  required: [],
198
198
  },
199
199
  handler: async (_args) => {
200
- const script = buildToolScript(`
201
- var seq = app.project.activeSequence;
202
- if (!seq) return __error("No active sequence");
203
- var settings = seq.getSettings();
204
- var fps = 25;
205
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
206
- var frticks = parseFloat(settings.videoFrameRate.ticks);
207
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
208
- }
209
- var endTicks = (seq.end != null) ? parseFloat(String(seq.end)) : 0;
210
- var frameRateTicks = fps > 0 ? TICKS_PER_SECOND / fps : TICKS_PER_SECOND / 25;
211
- var totalFrames = frameRateTicks > 0 ? Math.round(endTicks / frameRateTicks) : 0;
212
- return __result({
213
- totalFrames: totalFrames,
214
- frameRate: fps,
215
- durationSeconds: endTicks / TICKS_PER_SECOND
216
- });
200
+ const script = buildToolScript(`
201
+ var seq = app.project.activeSequence;
202
+ if (!seq) return __error("No active sequence");
203
+ var settings = seq.getSettings();
204
+ var fps = 25;
205
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
206
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
207
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
208
+ }
209
+ var endTicks = (seq.end != null) ? parseFloat(String(seq.end)) : 0;
210
+ var frameRateTicks = fps > 0 ? TICKS_PER_SECOND / fps : TICKS_PER_SECOND / 25;
211
+ var totalFrames = frameRateTicks > 0 ? Math.round(endTicks / frameRateTicks) : 0;
212
+ return __result({
213
+ totalFrames: totalFrames,
214
+ frameRate: fps,
215
+ durationSeconds: endTicks / TICKS_PER_SECOND
216
+ });
217
217
  `);
218
218
  return sendCommand(script, bridgeOptions);
219
219
  },
@@ -226,25 +226,25 @@ export function getSequenceSettingsTools(bridgeOptions) {
226
226
  required: [],
227
227
  },
228
228
  handler: async (_args) => {
229
- const script = buildToolScript(`
230
- var seq = app.project.activeSequence;
231
- if (!seq) return __error("No active sequence");
232
- var settings = seq.getSettings();
233
- var fps = 25;
234
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
235
- var frticks = parseFloat(settings.videoFrameRate.ticks);
236
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
237
- }
238
- var pos = seq.getPlayerPosition();
239
- var posTicks = pos ? pos.ticks : "0";
240
- var posSeconds = __ticksToSeconds(posTicks);
241
- var timecode = __ticksToTimecode(posTicks, fps);
242
- return __result({
243
- timecode: timecode,
244
- seconds: posSeconds,
245
- ticks: posTicks,
246
- frameRate: fps
247
- });
229
+ const script = buildToolScript(`
230
+ var seq = app.project.activeSequence;
231
+ if (!seq) return __error("No active sequence");
232
+ var settings = seq.getSettings();
233
+ var fps = 25;
234
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
235
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
236
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
237
+ }
238
+ var pos = seq.getPlayerPosition();
239
+ var posTicks = pos ? pos.ticks : "0";
240
+ var posSeconds = __ticksToSeconds(posTicks);
241
+ var timecode = __ticksToTimecode(posTicks, fps);
242
+ return __result({
243
+ timecode: timecode,
244
+ seconds: posSeconds,
245
+ ticks: posTicks,
246
+ frameRate: fps
247
+ });
248
248
  `);
249
249
  return sendCommand(script, bridgeOptions);
250
250
  },
@@ -259,14 +259,14 @@ export function getSequenceSettingsTools(bridgeOptions) {
259
259
  required: ["format"],
260
260
  },
261
261
  handler: async (args) => {
262
- const script = buildToolScript(`
263
- var seq = app.project.activeSequence;
264
- if (!seq) return __error("No active sequence");
265
- var settings = seq.getSettings();
266
- if (!settings) return __error("Could not get sequence settings");
267
- settings.videoDisplayFormat = ${args.format};
268
- seq.setSettings(settings);
269
- return __result({ displayFormat: ${args.format} });
262
+ const script = buildToolScript(`
263
+ var seq = app.project.activeSequence;
264
+ if (!seq) return __error("No active sequence");
265
+ var settings = seq.getSettings();
266
+ if (!settings) return __error("Could not get sequence settings");
267
+ settings.videoDisplayFormat = ${args.format};
268
+ seq.setSettings(settings);
269
+ return __result({ displayFormat: ${args.format} });
270
270
  `);
271
271
  return sendCommand(script, bridgeOptions);
272
272
  },
@@ -279,26 +279,26 @@ export function getSequenceSettingsTools(bridgeOptions) {
279
279
  required: [],
280
280
  },
281
281
  handler: async (_args) => {
282
- const script = buildToolScript(`
283
- var seq = app.project.activeSequence;
284
- if (!seq) return __error("No active sequence");
285
- var settings = seq.getSettings();
286
- var fps = 25;
287
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
288
- var frticks = parseFloat(settings.videoFrameRate.ticks);
289
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
290
- }
291
- return __result({
292
- sequenceName: seq.name,
293
- frameRate: fps,
294
- videoDisplayFormat: settings ? settings.videoDisplayFormat : 0,
295
- audioDisplayFormat: settings ? settings.audioDisplayFormat : 0,
296
- width: settings ? settings.videoFrameWidth : 0,
297
- height: settings ? settings.videoFrameHeight : 0,
298
- numVideoTracks: seq.videoTracks ? seq.videoTracks.numTracks : 0,
299
- numAudioTracks: seq.audioTracks ? seq.audioTracks.numTracks : 0,
300
- note: "Snapping and zoom settings are UI-only and not accessible via ExtendScript."
301
- });
282
+ const script = buildToolScript(`
283
+ var seq = app.project.activeSequence;
284
+ if (!seq) return __error("No active sequence");
285
+ var settings = seq.getSettings();
286
+ var fps = 25;
287
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
288
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
289
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
290
+ }
291
+ return __result({
292
+ sequenceName: seq.name,
293
+ frameRate: fps,
294
+ videoDisplayFormat: settings ? settings.videoDisplayFormat : 0,
295
+ audioDisplayFormat: settings ? settings.audioDisplayFormat : 0,
296
+ width: settings ? settings.videoFrameWidth : 0,
297
+ height: settings ? settings.videoFrameHeight : 0,
298
+ numVideoTracks: seq.videoTracks ? seq.videoTracks.numTracks : 0,
299
+ numAudioTracks: seq.audioTracks ? seq.audioTracks.numTracks : 0,
300
+ note: "Snapping and zoom settings are UI-only and not accessible via ExtendScript."
301
+ });
302
302
  `);
303
303
  return sendCommand(script, bridgeOptions);
304
304
  },
@@ -313,15 +313,15 @@ export function getSequenceSettingsTools(bridgeOptions) {
313
313
  required: ["frames"],
314
314
  },
315
315
  handler: async (args) => {
316
- const script = buildToolScript(`
317
- try {
318
- app.enableQE();
319
- if (qe && qe.project && qe.project.setVideoTransitionDefaultDuration) {
320
- qe.project.setVideoTransitionDefaultDuration(${args.frames});
321
- return __result({ frames: ${args.frames}, method: "qe" });
322
- }
323
- } catch(e) {}
324
- return __result({ note: "Default transition duration set to ${args.frames} frames. Apply via Edit > Preferences > Timeline in Premiere Pro UI if QE DOM unavailable.", frames: ${args.frames} });
316
+ const script = buildToolScript(`
317
+ try {
318
+ app.enableQE();
319
+ if (qe && qe.project && qe.project.setVideoTransitionDefaultDuration) {
320
+ qe.project.setVideoTransitionDefaultDuration(${args.frames});
321
+ return __result({ frames: ${args.frames}, method: "qe" });
322
+ }
323
+ } catch(e) {}
324
+ return __result({ note: "Default transition duration set to ${args.frames} frames. Apply via Edit > Preferences > Timeline in Premiere Pro UI if QE DOM unavailable.", frames: ${args.frames} });
325
325
  `);
326
326
  return sendCommand(script, bridgeOptions);
327
327
  },
@@ -334,26 +334,26 @@ export function getSequenceSettingsTools(bridgeOptions) {
334
334
  required: [],
335
335
  },
336
336
  handler: async (_args) => {
337
- const script = buildToolScript(`
338
- var info = { version: app.version };
339
- try {
340
- app.enableQE();
341
- if (qe && qe.project) {
342
- if (qe.project.getActiveRenderer) {
343
- info.renderer = qe.project.getActiveRenderer();
344
- }
345
- if (qe.project.getAvailableRenderers) {
346
- info.availableRenderers = qe.project.getAvailableRenderers();
347
- }
348
- }
349
- } catch(e) {
350
- info.rendererNote = "QE DOM unavailable: " + e.toString();
351
- }
352
- if (!info.renderer) {
353
- info.renderer = "unknown";
354
- info.note = "Renderer info requires QE DOM access. Check Edit > Project Settings > General > Renderer in Premiere Pro UI.";
355
- }
356
- return __result(info);
337
+ const script = buildToolScript(`
338
+ var info = { version: app.version };
339
+ try {
340
+ app.enableQE();
341
+ if (qe && qe.project) {
342
+ if (qe.project.getActiveRenderer) {
343
+ info.renderer = qe.project.getActiveRenderer();
344
+ }
345
+ if (qe.project.getAvailableRenderers) {
346
+ info.availableRenderers = qe.project.getAvailableRenderers();
347
+ }
348
+ }
349
+ } catch(e) {
350
+ info.rendererNote = "QE DOM unavailable: " + e.toString();
351
+ }
352
+ if (!info.renderer) {
353
+ info.renderer = "unknown";
354
+ info.note = "Renderer info requires QE DOM access. Check Edit > Project Settings > General > Renderer in Premiere Pro UI.";
355
+ }
356
+ return __result(info);
357
357
  `);
358
358
  return sendCommand(script, bridgeOptions);
359
359
  },
@@ -366,23 +366,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
366
366
  required: [],
367
367
  },
368
368
  handler: async (_args) => {
369
- const script = buildToolScript(`
370
- var info = { version: app.version, os: $.os };
371
- try {
372
- app.enableQE();
373
- if (qe && qe.project) {
374
- info.gpuAcceleration = "enabled (QE DOM accessible)";
375
- if (qe.project.getActiveRenderer) {
376
- var renderer = qe.project.getActiveRenderer();
377
- info.activeRenderer = renderer;
378
- info.gpuAcceleration = (renderer && renderer.indexOf("GPU") !== -1) ? "GPU" : "Software";
379
- }
380
- }
381
- } catch(e) {
382
- info.gpuAcceleration = "unknown";
383
- info.note = "GPU info limited in ExtendScript. " + e.toString();
384
- }
385
- return __result(info);
369
+ const script = buildToolScript(`
370
+ var info = { version: app.version, os: $.os };
371
+ try {
372
+ app.enableQE();
373
+ if (qe && qe.project) {
374
+ info.gpuAcceleration = "enabled (QE DOM accessible)";
375
+ if (qe.project.getActiveRenderer) {
376
+ var renderer = qe.project.getActiveRenderer();
377
+ info.activeRenderer = renderer;
378
+ info.gpuAcceleration = (renderer && renderer.indexOf("GPU") !== -1) ? "GPU" : "Software";
379
+ }
380
+ }
381
+ } catch(e) {
382
+ info.gpuAcceleration = "unknown";
383
+ info.note = "GPU info limited in ExtendScript. " + e.toString();
384
+ }
385
+ return __result(info);
386
386
  `);
387
387
  return sendCommand(script, bridgeOptions);
388
388
  },
@@ -398,18 +398,18 @@ export function getSequenceSettingsTools(bridgeOptions) {
398
398
  },
399
399
  handler: async (args) => {
400
400
  const rendererNameEsc = args.renderer_name.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
401
- const script = buildToolScript(`
402
- var rendererName = "${rendererNameEsc}";
403
- try {
404
- app.enableQE();
405
- if (qe && qe.project && qe.project.setRenderer) {
406
- qe.project.setRenderer(rendererName);
407
- return __result({ renderer: rendererName, applied: true });
408
- }
409
- } catch(e) {
410
- return __error("Could not set renderer via QE DOM: " + e.toString());
411
- }
412
- return __result({ note: "setRenderer not available via QE DOM in this version. Change renderer via Edit > Project Settings > General > Renderer.", requested: rendererName });
401
+ const script = buildToolScript(`
402
+ var rendererName = "${rendererNameEsc}";
403
+ try {
404
+ app.enableQE();
405
+ if (qe && qe.project && qe.project.setRenderer) {
406
+ qe.project.setRenderer(rendererName);
407
+ return __result({ renderer: rendererName, applied: true });
408
+ }
409
+ } catch(e) {
410
+ return __error("Could not set renderer via QE DOM: " + e.toString());
411
+ }
412
+ return __result({ note: "setRenderer not available via QE DOM in this version. Change renderer via Edit > Project Settings > General > Renderer.", requested: rendererName });
413
413
  `);
414
414
  return sendCommand(script, bridgeOptions);
415
415
  },
@@ -422,29 +422,29 @@ export function getSequenceSettingsTools(bridgeOptions) {
422
422
  required: [],
423
423
  },
424
424
  handler: async (_args) => {
425
- const script = buildToolScript(`
426
- var info = {};
427
- try {
428
- app.enableQE();
429
- if (qe && qe.project) {
430
- var qeSeq = qe.project.getActiveSequence();
431
- if (qeSeq) {
432
- if (qeSeq.getPlaybackResolution) {
433
- info.resolution = qeSeq.getPlaybackResolution();
434
- }
435
- if (qeSeq.getPausedResolution) {
436
- info.pausedResolution = qeSeq.getPausedResolution();
437
- }
438
- }
439
- }
440
- } catch(e) {
441
- info.note = "QE DOM error: " + e.toString();
442
- }
443
- if (!info.resolution) {
444
- info.resolution = "unknown";
445
- info.note = "Playback resolution is a UI setting. Check Program Monitor > wrench icon > Playback Resolution.";
446
- }
447
- return __result(info);
425
+ const script = buildToolScript(`
426
+ var info = {};
427
+ try {
428
+ app.enableQE();
429
+ if (qe && qe.project) {
430
+ var qeSeq = qe.project.getActiveSequence();
431
+ if (qeSeq) {
432
+ if (qeSeq.getPlaybackResolution) {
433
+ info.resolution = qeSeq.getPlaybackResolution();
434
+ }
435
+ if (qeSeq.getPausedResolution) {
436
+ info.pausedResolution = qeSeq.getPausedResolution();
437
+ }
438
+ }
439
+ }
440
+ } catch(e) {
441
+ info.note = "QE DOM error: " + e.toString();
442
+ }
443
+ if (!info.resolution) {
444
+ info.resolution = "unknown";
445
+ info.note = "Playback resolution is a UI setting. Check Program Monitor > wrench icon > Playback Resolution.";
446
+ }
447
+ return __result(info);
448
448
  `);
449
449
  return sendCommand(script, bridgeOptions);
450
450
  },
@@ -460,24 +460,24 @@ export function getSequenceSettingsTools(bridgeOptions) {
460
460
  },
461
461
  handler: async (args) => {
462
462
  const qualityEsc = args.quality.replace(/"/g, '\\"').toLowerCase();
463
- const script = buildToolScript(`
464
- var quality = "${qualityEsc}";
465
- var qualityMap = { "full": 1, "half": 2, "quarter": 4, "eighth": 8 };
466
- var qVal = qualityMap[quality];
467
- if (!qVal) return __error("Invalid quality. Use: full, half, quarter, or eighth");
468
- try {
469
- app.enableQE();
470
- if (qe && qe.project) {
471
- var qeSeq = qe.project.getActiveSequence();
472
- if (qeSeq && qeSeq.setPlaybackResolution) {
473
- qeSeq.setPlaybackResolution(qVal);
474
- return __result({ quality: quality, value: qVal, applied: true });
475
- }
476
- }
477
- } catch(e) {
478
- return __error("Could not set playback resolution via QE DOM: " + e.toString());
479
- }
480
- return __result({ note: "setPlaybackResolution not available in this version. Change via Program Monitor wrench menu.", requested: quality });
463
+ const script = buildToolScript(`
464
+ var quality = "${qualityEsc}";
465
+ var qualityMap = { "full": 1, "half": 2, "quarter": 4, "eighth": 8 };
466
+ var qVal = qualityMap[quality];
467
+ if (!qVal) return __error("Invalid quality. Use: full, half, quarter, or eighth");
468
+ try {
469
+ app.enableQE();
470
+ if (qe && qe.project) {
471
+ var qeSeq = qe.project.getActiveSequence();
472
+ if (qeSeq && qeSeq.setPlaybackResolution) {
473
+ qeSeq.setPlaybackResolution(qVal);
474
+ return __result({ quality: quality, value: qVal, applied: true });
475
+ }
476
+ }
477
+ } catch(e) {
478
+ return __error("Could not set playback resolution via QE DOM: " + e.toString());
479
+ }
480
+ return __result({ note: "setPlaybackResolution not available in this version. Change via Program Monitor wrench menu.", requested: quality });
481
481
  `);
482
482
  return sendCommand(script, bridgeOptions);
483
483
  },
@@ -490,49 +490,49 @@ export function getSequenceSettingsTools(bridgeOptions) {
490
490
  required: [],
491
491
  },
492
492
  handler: async (_args) => {
493
- const script = buildToolScript(`
494
- // Probe known install locations, Windows and macOS, PP 2026 down to
495
- // CC 2023, and use the first one that actually exists.
496
- var dirCandidates = [
497
- "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro 2026\\\\Settings\\\\SequencePresets",
498
- "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro 2025\\\\Settings\\\\SequencePresets",
499
- "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro 2024\\\\Settings\\\\SequencePresets",
500
- "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro CC 2023\\\\Settings\\\\SequencePresets",
501
- "/Applications/Adobe Premiere Pro 2026/Adobe Premiere Pro 2026.app/Contents/SequencePresets",
502
- "/Applications/Adobe Premiere Pro 2025/Adobe Premiere Pro 2025.app/Contents/SequencePresets",
503
- "/Applications/Adobe Premiere Pro 2024/Adobe Premiere Pro 2024.app/Contents/SequencePresets",
504
- "/Applications/Adobe Premiere Pro CC 2023/Adobe Premiere Pro CC 2023.app/Contents/SequencePresets"
505
- ];
506
- var presetDir = null;
507
- for (var di = 0; di < dirCandidates.length; di++) {
508
- var cand = new Folder(dirCandidates[di]);
509
- if (cand.exists) { presetDir = cand; break; }
510
- }
511
- var presets = [];
512
- if (presetDir) {
513
- var files = presetDir.getFiles("*.sqpreset");
514
- for (var i = 0; i < files.length; i++) {
515
- presets.push({ name: files[i].name, path: files[i].fsName });
516
- }
517
- var subFolders = presetDir.getFiles(function(f) { return f instanceof Folder; });
518
- for (var sf = 0; sf < subFolders.length; sf++) {
519
- var subFiles = subFolders[sf].getFiles("*.sqpreset");
520
- for (var ff = 0; ff < subFiles.length; ff++) {
521
- presets.push({ name: subFolders[sf].name + "/" + subFiles[ff].name, path: subFiles[ff].fsName });
522
- }
523
- }
524
- }
525
- if (presets.length === 0) {
526
- presets = [
527
- { name: "AVCHD 1080p25", path: "SequencePresets/AVCHD/1080p/AVCHD 1080p25.sqpreset" },
528
- { name: "AVCHD 1080p30", path: "SequencePresets/AVCHD/1080p/AVCHD 1080p30.sqpreset" },
529
- { name: "HDV 1080p25", path: "SequencePresets/HDV/HDV 1080p25.sqpreset" },
530
- { name: "DSLR 1080p24", path: "SequencePresets/DSLR/DSLR 1080p24.sqpreset" },
531
- { name: "REDCine-X 4K", path: "SequencePresets/RED R3D/4K/REDCine-X 4K.sqpreset" }
532
- ];
533
- return __result({ presets: presets, note: "Preset directory not found at expected path; returning common presets list." });
534
- }
535
- return __result({ presets: presets, count: presets.length });
493
+ const script = buildToolScript(`
494
+ // Probe known install locations, Windows and macOS, PP 2026 down to
495
+ // CC 2023, and use the first one that actually exists.
496
+ var dirCandidates = [
497
+ "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro 2026\\\\Settings\\\\SequencePresets",
498
+ "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro 2025\\\\Settings\\\\SequencePresets",
499
+ "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro 2024\\\\Settings\\\\SequencePresets",
500
+ "C:\\\\Program Files\\\\Adobe\\\\Adobe Premiere Pro CC 2023\\\\Settings\\\\SequencePresets",
501
+ "/Applications/Adobe Premiere Pro 2026/Adobe Premiere Pro 2026.app/Contents/SequencePresets",
502
+ "/Applications/Adobe Premiere Pro 2025/Adobe Premiere Pro 2025.app/Contents/SequencePresets",
503
+ "/Applications/Adobe Premiere Pro 2024/Adobe Premiere Pro 2024.app/Contents/SequencePresets",
504
+ "/Applications/Adobe Premiere Pro CC 2023/Adobe Premiere Pro CC 2023.app/Contents/SequencePresets"
505
+ ];
506
+ var presetDir = null;
507
+ for (var di = 0; di < dirCandidates.length; di++) {
508
+ var cand = new Folder(dirCandidates[di]);
509
+ if (cand.exists) { presetDir = cand; break; }
510
+ }
511
+ var presets = [];
512
+ if (presetDir) {
513
+ var files = presetDir.getFiles("*.sqpreset");
514
+ for (var i = 0; i < files.length; i++) {
515
+ presets.push({ name: files[i].name, path: files[i].fsName });
516
+ }
517
+ var subFolders = presetDir.getFiles(function(f) { return f instanceof Folder; });
518
+ for (var sf = 0; sf < subFolders.length; sf++) {
519
+ var subFiles = subFolders[sf].getFiles("*.sqpreset");
520
+ for (var ff = 0; ff < subFiles.length; ff++) {
521
+ presets.push({ name: subFolders[sf].name + "/" + subFiles[ff].name, path: subFiles[ff].fsName });
522
+ }
523
+ }
524
+ }
525
+ if (presets.length === 0) {
526
+ presets = [
527
+ { name: "AVCHD 1080p25", path: "SequencePresets/AVCHD/1080p/AVCHD 1080p25.sqpreset" },
528
+ { name: "AVCHD 1080p30", path: "SequencePresets/AVCHD/1080p/AVCHD 1080p30.sqpreset" },
529
+ { name: "HDV 1080p25", path: "SequencePresets/HDV/HDV 1080p25.sqpreset" },
530
+ { name: "DSLR 1080p24", path: "SequencePresets/DSLR/DSLR 1080p24.sqpreset" },
531
+ { name: "REDCine-X 4K", path: "SequencePresets/RED R3D/4K/REDCine-X 4K.sqpreset" }
532
+ ];
533
+ return __result({ presets: presets, note: "Preset directory not found at expected path; returning common presets list." });
534
+ }
535
+ return __result({ presets: presets, count: presets.length });
536
536
  `);
537
537
  return sendCommand(script, bridgeOptions);
538
538
  },
@@ -548,23 +548,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
548
548
  },
549
549
  handler: async (args) => {
550
550
  const presetPathEsc = args.preset_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
551
- const script = buildToolScript(`
552
- var presetPath = "${presetPathEsc}";
553
- var f = new File(presetPath);
554
- if (!f.exists) return __error("Preset file not found: " + presetPath);
555
- // Try to store as application preference
556
- var stored = false;
557
- try {
558
- if (app.setPreference) { app.setPreference("defaultSequencePreset", presetPath); stored = true; }
559
- } catch(e) {}
560
- // Validate preset by testing it with QE
561
- var validated = false;
562
- try {
563
- app.enableQE();
564
- if (qe && qe.project) { validated = true; }
565
- } catch(e2) {}
566
- return __result({ presetPath: presetPath, exists: true, stored: stored, validated: validated,
567
- note: stored ? "Default preset preference saved." : "Preset validated but could not store preference (not supported in this PP version). To persist default, use Sequence > New Sequence > and select this preset manually once." });
551
+ const script = buildToolScript(`
552
+ var presetPath = "${presetPathEsc}";
553
+ var f = new File(presetPath);
554
+ if (!f.exists) return __error("Preset file not found: " + presetPath);
555
+ // Try to store as application preference
556
+ var stored = false;
557
+ try {
558
+ if (app.setPreference) { app.setPreference("defaultSequencePreset", presetPath); stored = true; }
559
+ } catch(e) {}
560
+ // Validate preset by testing it with QE
561
+ var validated = false;
562
+ try {
563
+ app.enableQE();
564
+ if (qe && qe.project) { validated = true; }
565
+ } catch(e2) {}
566
+ return __result({ presetPath: presetPath, exists: true, stored: stored, validated: validated,
567
+ note: stored ? "Default preset preference saved." : "Preset validated but could not store preference (not supported in this PP version). To persist default, use Sequence > New Sequence > and select this preset manually once." });
568
568
  `);
569
569
  return sendCommand(script, bridgeOptions);
570
570
  },
@@ -577,27 +577,27 @@ export function getSequenceSettingsTools(bridgeOptions) {
577
577
  required: [],
578
578
  },
579
579
  handler: async (_args) => {
580
- const script = buildToolScript(`
581
- var info = {
582
- note: "Auto-save settings are stored in Premiere Pro application preferences (not accessible via ExtendScript). Default values shown.",
583
- autoSaveEnabled: true,
584
- intervalMinutes: 15,
585
- maxVersions: 20
586
- };
587
- try {
588
- if (app.properties) {
589
- var interval = app.properties.getProperty("Auto-Save.interval");
590
- if (interval !== undefined) info.intervalMinutes = interval;
591
- var maxV = app.properties.getProperty("Auto-Save.maxVersions");
592
- if (maxV !== undefined) info.maxVersions = maxV;
593
- var enabled = app.properties.getProperty("Auto-Save.enabled");
594
- if (enabled !== undefined) info.autoSaveEnabled = enabled;
595
- delete info.note;
596
- }
597
- } catch(e) {
598
- info.propertiesError = e.toString();
599
- }
600
- return __result(info);
580
+ const script = buildToolScript(`
581
+ var info = {
582
+ note: "Auto-save settings are stored in Premiere Pro application preferences (not accessible via ExtendScript). Default values shown.",
583
+ autoSaveEnabled: true,
584
+ intervalMinutes: 15,
585
+ maxVersions: 20
586
+ };
587
+ try {
588
+ if (app.properties) {
589
+ var interval = app.properties.getProperty("Auto-Save.interval");
590
+ if (interval !== undefined) info.intervalMinutes = interval;
591
+ var maxV = app.properties.getProperty("Auto-Save.maxVersions");
592
+ if (maxV !== undefined) info.maxVersions = maxV;
593
+ var enabled = app.properties.getProperty("Auto-Save.enabled");
594
+ if (enabled !== undefined) info.autoSaveEnabled = enabled;
595
+ delete info.note;
596
+ }
597
+ } catch(e) {
598
+ info.propertiesError = e.toString();
599
+ }
600
+ return __result(info);
601
601
  `);
602
602
  return sendCommand(script, bridgeOptions);
603
603
  },
@@ -612,15 +612,15 @@ export function getSequenceSettingsTools(bridgeOptions) {
612
612
  required: ["minutes"],
613
613
  },
614
614
  handler: async (args) => {
615
- const script = buildToolScript(`
616
- var minutes = ${args.minutes};
617
- try {
618
- if (app.properties && app.properties.setProperty) {
619
- app.properties.setProperty("Auto-Save.interval", minutes);
620
- return __result({ intervalMinutes: minutes, applied: true });
621
- }
622
- } catch(e) {}
623
- return __result({ note: "Auto-save interval not settable via ExtendScript in this version. Change via Edit > Preferences > Auto Save. Requested: " + minutes + " minutes.", requestedMinutes: minutes });
615
+ const script = buildToolScript(`
616
+ var minutes = ${args.minutes};
617
+ try {
618
+ if (app.properties && app.properties.setProperty) {
619
+ app.properties.setProperty("Auto-Save.interval", minutes);
620
+ return __result({ intervalMinutes: minutes, applied: true });
621
+ }
622
+ } catch(e) {}
623
+ return __result({ note: "Auto-save interval not settable via ExtendScript in this version. Change via Edit > Preferences > Auto Save. Requested: " + minutes + " minutes.", requestedMinutes: minutes });
624
624
  `);
625
625
  return sendCommand(script, bridgeOptions);
626
626
  },
@@ -635,15 +635,15 @@ export function getSequenceSettingsTools(bridgeOptions) {
635
635
  required: ["enabled"],
636
636
  },
637
637
  handler: async (args) => {
638
- const script = buildToolScript(`
639
- var enabled = ${args.enabled};
640
- try {
641
- if (app.properties && app.properties.setProperty) {
642
- app.properties.setProperty("Auto-Save.enabled", enabled);
643
- return __result({ autoSaveEnabled: enabled, applied: true });
644
- }
645
- } catch(e) {}
646
- return __result({ note: "Auto-save enable/disable not settable via ExtendScript in this version. Change via Edit > Preferences > Auto Save.", requestedEnabled: enabled });
638
+ const script = buildToolScript(`
639
+ var enabled = ${args.enabled};
640
+ try {
641
+ if (app.properties && app.properties.setProperty) {
642
+ app.properties.setProperty("Auto-Save.enabled", enabled);
643
+ return __result({ autoSaveEnabled: enabled, applied: true });
644
+ }
645
+ } catch(e) {}
646
+ return __result({ note: "Auto-save enable/disable not settable via ExtendScript in this version. Change via Edit > Preferences > Auto Save.", requestedEnabled: enabled });
647
647
  `);
648
648
  return sendCommand(script, bridgeOptions);
649
649
  },
@@ -658,16 +658,16 @@ export function getSequenceSettingsTools(bridgeOptions) {
658
658
  required: ["frames"],
659
659
  },
660
660
  handler: async (args) => {
661
- const script = buildToolScript(`
662
- var frames = ${args.frames};
663
- try {
664
- app.enableQE();
665
- if (qe && qe.project && qe.project.setStillImageDefaultDuration) {
666
- qe.project.setStillImageDefaultDuration(frames);
667
- return __result({ frames: frames, applied: true });
668
- }
669
- } catch(e) {}
670
- return __result({ note: "Default still duration not settable via ExtendScript/QE in this version. Change via Edit > Preferences > Timeline > Still Image Default Duration.", requestedFrames: frames });
661
+ const script = buildToolScript(`
662
+ var frames = ${args.frames};
663
+ try {
664
+ app.enableQE();
665
+ if (qe && qe.project && qe.project.setStillImageDefaultDuration) {
666
+ qe.project.setStillImageDefaultDuration(frames);
667
+ return __result({ frames: frames, applied: true });
668
+ }
669
+ } catch(e) {}
670
+ return __result({ note: "Default still duration not settable via ExtendScript/QE in this version. Change via Edit > Preferences > Timeline > Still Image Default Duration.", requestedFrames: frames });
671
671
  `);
672
672
  return sendCommand(script, bridgeOptions);
673
673
  },
@@ -682,28 +682,28 @@ export function getSequenceSettingsTools(bridgeOptions) {
682
682
  required: ["seconds"],
683
683
  },
684
684
  handler: async (args) => {
685
- const script = buildToolScript(`
686
- var seconds = ${args.seconds};
687
- try {
688
- app.enableQE();
689
- if (qe && qe.project) {
690
- var seq = app.project.activeSequence;
691
- var fps = 25;
692
- if (seq) {
693
- var settings = seq.getSettings();
694
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
695
- var frticks = parseFloat(settings.videoFrameRate.ticks);
696
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
697
- }
698
- }
699
- var frames = Math.round(seconds * fps);
700
- if (qe.project.setVideoTransitionDefaultDuration) {
701
- qe.project.setVideoTransitionDefaultDuration(frames);
702
- return __result({ seconds: seconds, frames: frames, fps: fps, applied: true });
703
- }
704
- }
705
- } catch(e) {}
706
- return __result({ note: "Default transition duration not settable via ExtendScript in this version. Change via Edit > Preferences > Timeline > Video Transition Default Duration.", requestedSeconds: seconds });
685
+ const script = buildToolScript(`
686
+ var seconds = ${args.seconds};
687
+ try {
688
+ app.enableQE();
689
+ if (qe && qe.project) {
690
+ var seq = app.project.activeSequence;
691
+ var fps = 25;
692
+ if (seq) {
693
+ var settings = seq.getSettings();
694
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
695
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
696
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
697
+ }
698
+ }
699
+ var frames = Math.round(seconds * fps);
700
+ if (qe.project.setVideoTransitionDefaultDuration) {
701
+ qe.project.setVideoTransitionDefaultDuration(frames);
702
+ return __result({ seconds: seconds, frames: frames, fps: fps, applied: true });
703
+ }
704
+ }
705
+ } catch(e) {}
706
+ return __result({ note: "Default transition duration not settable via ExtendScript in this version. Change via Edit > Preferences > Timeline > Video Transition Default Duration.", requestedSeconds: seconds });
707
707
  `);
708
708
  return sendCommand(script, bridgeOptions);
709
709
  },
@@ -718,28 +718,28 @@ export function getSequenceSettingsTools(bridgeOptions) {
718
718
  required: ["seconds"],
719
719
  },
720
720
  handler: async (args) => {
721
- const script = buildToolScript(`
722
- var seconds = ${args.seconds};
723
- try {
724
- app.enableQE();
725
- if (qe && qe.project) {
726
- var seq = app.project.activeSequence;
727
- var fps = 25;
728
- if (seq) {
729
- var settings = seq.getSettings();
730
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
731
- var frticks = parseFloat(settings.videoFrameRate.ticks);
732
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
733
- }
734
- }
735
- var frames = Math.round(seconds * fps);
736
- if (qe.project.setAudioTransitionDefaultDuration) {
737
- qe.project.setAudioTransitionDefaultDuration(frames);
738
- return __result({ seconds: seconds, frames: frames, fps: fps, applied: true });
739
- }
740
- }
741
- } catch(e) {}
742
- return __result({ note: "Default audio transition duration not settable via ExtendScript in this version. Change via Edit > Preferences > Timeline > Audio Transition Default Duration.", requestedSeconds: seconds });
721
+ const script = buildToolScript(`
722
+ var seconds = ${args.seconds};
723
+ try {
724
+ app.enableQE();
725
+ if (qe && qe.project) {
726
+ var seq = app.project.activeSequence;
727
+ var fps = 25;
728
+ if (seq) {
729
+ var settings = seq.getSettings();
730
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
731
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
732
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
733
+ }
734
+ }
735
+ var frames = Math.round(seconds * fps);
736
+ if (qe.project.setAudioTransitionDefaultDuration) {
737
+ qe.project.setAudioTransitionDefaultDuration(frames);
738
+ return __result({ seconds: seconds, frames: frames, fps: fps, applied: true });
739
+ }
740
+ }
741
+ } catch(e) {}
742
+ return __result({ note: "Default audio transition duration not settable via ExtendScript in this version. Change via Edit > Preferences > Timeline > Audio Transition Default Duration.", requestedSeconds: seconds });
743
743
  `);
744
744
  return sendCommand(script, bridgeOptions);
745
745
  },
@@ -752,32 +752,32 @@ export function getSequenceSettingsTools(bridgeOptions) {
752
752
  required: [],
753
753
  },
754
754
  handler: async (_args) => {
755
- const script = buildToolScript(`
756
- var prefs = {
757
- version: app.version,
758
- build: app.build || "unknown",
759
- os: $.os,
760
- locale: $.locale || "unknown",
761
- projectPath: app.project ? app.project.path : "no project",
762
- projectName: app.project ? app.project.name : "no project",
763
- numSequences: app.project && app.project.sequences ? app.project.sequences.numSequences : 0
764
- };
765
- var seq = app.project ? app.project.activeSequence : null;
766
- if (seq) {
767
- var settings = seq.getSettings();
768
- var fps = 25;
769
- if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
770
- var frticks = parseFloat(settings.videoFrameRate.ticks);
771
- if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
772
- }
773
- prefs.activeSequence = {
774
- name: seq.name,
775
- width: settings ? settings.videoFrameWidth : 0,
776
- height: settings ? settings.videoFrameHeight : 0,
777
- frameRate: fps
778
- };
779
- }
780
- return __result(prefs);
755
+ const script = buildToolScript(`
756
+ var prefs = {
757
+ version: app.version,
758
+ build: app.build || "unknown",
759
+ os: $.os,
760
+ locale: $.locale || "unknown",
761
+ projectPath: app.project ? app.project.path : "no project",
762
+ projectName: app.project ? app.project.name : "no project",
763
+ numSequences: app.project && app.project.sequences ? app.project.sequences.numSequences : 0
764
+ };
765
+ var seq = app.project ? app.project.activeSequence : null;
766
+ if (seq) {
767
+ var settings = seq.getSettings();
768
+ var fps = 25;
769
+ if (settings && settings.videoFrameRate && settings.videoFrameRate.ticks) {
770
+ var frticks = parseFloat(settings.videoFrameRate.ticks);
771
+ if (frticks > 0) fps = TICKS_PER_SECOND / frticks;
772
+ }
773
+ prefs.activeSequence = {
774
+ name: seq.name,
775
+ width: settings ? settings.videoFrameWidth : 0,
776
+ height: settings ? settings.videoFrameHeight : 0,
777
+ frameRate: fps
778
+ };
779
+ }
780
+ return __result(prefs);
781
781
  `);
782
782
  return sendCommand(script, bridgeOptions);
783
783
  },
@@ -790,23 +790,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
790
790
  required: [],
791
791
  },
792
792
  handler: async (_args) => {
793
- const script = buildToolScript(`
794
- var info = {
795
- note: "Detailed memory allocation settings (RAM reserved for other apps) are stored in application preferences and not directly readable via ExtendScript.",
796
- version: app.version,
797
- os: $.os
798
- };
799
- try {
800
- if ($.memCache !== undefined) info.memCache = $.memCache;
801
- if ($.screens) {
802
- var screens = [];
803
- for (var i = 0; i < $.screens.length; i++) {
804
- screens.push({ width: $.screens[i].width, height: $.screens[i].height });
805
- }
806
- info.screens = screens;
807
- }
808
- } catch(e) {}
809
- return __result(info);
793
+ const script = buildToolScript(`
794
+ var info = {
795
+ note: "Detailed memory allocation settings (RAM reserved for other apps) are stored in application preferences and not directly readable via ExtendScript.",
796
+ version: app.version,
797
+ os: $.os
798
+ };
799
+ try {
800
+ if ($.memCache !== undefined) info.memCache = $.memCache;
801
+ if ($.screens) {
802
+ var screens = [];
803
+ for (var i = 0; i < $.screens.length; i++) {
804
+ screens.push({ width: $.screens[i].width, height: $.screens[i].height });
805
+ }
806
+ info.screens = screens;
807
+ }
808
+ } catch(e) {}
809
+ return __result(info);
810
810
  `);
811
811
  return sendCommand(script, bridgeOptions);
812
812
  },
@@ -819,16 +819,16 @@ export function getSequenceSettingsTools(bridgeOptions) {
819
819
  required: [],
820
820
  },
821
821
  handler: async (_args) => {
822
- const script = buildToolScript(`
823
- try {
824
- if (app.project && app.project.deleteCache) {
825
- app.project.deleteCache(0);
826
- return __result({ success: true, message: "Media cache deleted (unused files)." });
827
- }
828
- } catch(e) {
829
- return __error("deleteCache failed: " + e.toString());
830
- }
831
- return __result({ note: "app.project.deleteCache not available in this version. Clear via Edit > Preferences > Media Cache > Delete." });
822
+ const script = buildToolScript(`
823
+ try {
824
+ if (app.project && app.project.deleteCache) {
825
+ app.project.deleteCache(0);
826
+ return __result({ success: true, message: "Media cache deleted (unused files)." });
827
+ }
828
+ } catch(e) {
829
+ return __error("deleteCache failed: " + e.toString());
830
+ }
831
+ return __result({ note: "app.project.deleteCache not available in this version. Clear via Edit > Preferences > Media Cache > Delete." });
832
832
  `);
833
833
  return sendCommand(script, bridgeOptions);
834
834
  },
@@ -841,25 +841,25 @@ export function getSequenceSettingsTools(bridgeOptions) {
841
841
  required: [],
842
842
  },
843
843
  handler: async (_args) => {
844
- const script = buildToolScript(`
845
- var info = { version: app.version };
846
- try {
847
- // Scratch disks ARE accessible via ExtendScript
848
- if (app.project.getScratchDiskPath) {
849
- info.videoCaptureDir = app.project.getScratchDiskPath(1);
850
- info.audioPreviewDir = app.project.getScratchDiskPath(2);
851
- info.videoPreviewDir = app.project.getScratchDiskPath(3);
852
- info.autoSaveDir = app.project.getScratchDiskPath(4);
853
- }
854
- } catch(e) {}
855
- try {
856
- if (app.project.path) {
857
- var projFile = new File(app.project.path);
858
- info.projectDir = projFile.parent.fsName;
859
- }
860
- } catch(e2) {}
861
- info.note = "Full media cache path/size settings require Preferences API not available in ExtendScript. Scratch disk locations shown above.";
862
- return __result(info);
844
+ const script = buildToolScript(`
845
+ var info = { version: app.version };
846
+ try {
847
+ // Scratch disks ARE accessible via ExtendScript
848
+ if (app.project.getScratchDiskPath) {
849
+ info.videoCaptureDir = app.project.getScratchDiskPath(1);
850
+ info.audioPreviewDir = app.project.getScratchDiskPath(2);
851
+ info.videoPreviewDir = app.project.getScratchDiskPath(3);
852
+ info.autoSaveDir = app.project.getScratchDiskPath(4);
853
+ }
854
+ } catch(e) {}
855
+ try {
856
+ if (app.project.path) {
857
+ var projFile = new File(app.project.path);
858
+ info.projectDir = projFile.parent.fsName;
859
+ }
860
+ } catch(e2) {}
861
+ info.note = "Full media cache path/size settings require Preferences API not available in ExtendScript. Scratch disk locations shown above.";
862
+ return __result(info);
863
863
  `);
864
864
  return sendCommand(script, bridgeOptions);
865
865
  },
@@ -872,23 +872,23 @@ export function getSequenceSettingsTools(bridgeOptions) {
872
872
  required: [],
873
873
  },
874
874
  handler: async (_args) => {
875
- const script = buildToolScript(`
876
- var info = {
877
- os: $.os,
878
- version: app.version,
879
- build: app.build || "unknown",
880
- locale: $.locale || "unknown",
881
- jsxVersion: $.version || "unknown"
882
- };
883
- try {
884
- app.enableQE();
885
- if (qe && qe.project && qe.project.getActiveRenderer) {
886
- info.renderer = qe.project.getActiveRenderer();
887
- }
888
- } catch(e) {
889
- info.rendererNote = "QE DOM unavailable";
890
- }
891
- return __result(info);
875
+ const script = buildToolScript(`
876
+ var info = {
877
+ os: $.os,
878
+ version: app.version,
879
+ build: app.build || "unknown",
880
+ locale: $.locale || "unknown",
881
+ jsxVersion: $.version || "unknown"
882
+ };
883
+ try {
884
+ app.enableQE();
885
+ if (qe && qe.project && qe.project.getActiveRenderer) {
886
+ info.renderer = qe.project.getActiveRenderer();
887
+ }
888
+ } catch(e) {
889
+ info.rendererNote = "QE DOM unavailable";
890
+ }
891
+ return __result(info);
892
892
  `);
893
893
  return sendCommand(script, bridgeOptions);
894
894
  },
@@ -901,19 +901,19 @@ export function getSequenceSettingsTools(bridgeOptions) {
901
901
  required: [],
902
902
  },
903
903
  handler: async (_args) => {
904
- const script = buildToolScript(`
905
- if (!app.project) return __error("No project open");
906
- var info = {
907
- name: app.project.name,
908
- path: app.project.path,
909
- numSequences: app.project.sequences ? app.project.sequences.numSequences : 0,
910
- numProjectItems: app.project.rootItem ? app.project.rootItem.children.numItems : 0
911
- };
912
- try {
913
- var scratchDisk = app.project.getScratchDiskPath ? app.project.getScratchDiskPath(1) : null;
914
- if (scratchDisk) info.capturedVideoPath = scratchDisk;
915
- } catch(e) {}
916
- return __result(info);
904
+ const script = buildToolScript(`
905
+ if (!app.project) return __error("No project open");
906
+ var info = {
907
+ name: app.project.name,
908
+ path: app.project.path,
909
+ numSequences: app.project.sequences ? app.project.sequences.numSequences : 0,
910
+ numProjectItems: app.project.rootItem ? app.project.rootItem.children.numItems : 0
911
+ };
912
+ try {
913
+ var scratchDisk = app.project.getScratchDiskPath ? app.project.getScratchDiskPath(1) : null;
914
+ if (scratchDisk) info.capturedVideoPath = scratchDisk;
915
+ } catch(e) {}
916
+ return __result(info);
917
917
  `);
918
918
  return sendCommand(script, bridgeOptions);
919
919
  },
@@ -928,44 +928,44 @@ export function getSequenceSettingsTools(bridgeOptions) {
928
928
  required: ["project_item_index"],
929
929
  },
930
930
  handler: async (args) => {
931
- const script = buildToolScript(`
932
- var itemIndex = ${args.project_item_index};
933
- if (!app.project) return __error("No project open");
934
- var rootItem = app.project.rootItem;
935
- if (!rootItem || !rootItem.children || itemIndex >= rootItem.children.numItems) {
936
- return __error("Project item index " + itemIndex + " not found");
937
- }
938
- var item = rootItem.children[itemIndex];
939
- var seq = app.project.activeSequence;
940
- if (!seq) return __error("No active sequence");
941
- // getVideoMetaData() returns a metadata STRING, not an object with
942
- // numeric .frameWidth/.frameHeight/.frameRate. Derive the frame rate
943
- // from the footage interpretation instead, which exposes a numeric
944
- // .frameRate. Width/height are not reliably available from a project
945
- // item here, so leave them unchanged.
946
- var clipFrameRate = null;
947
- try {
948
- var interp = item.getFootageInterpretation ? item.getFootageInterpretation() : null;
949
- if (interp && interp.frameRate) clipFrameRate = interp.frameRate;
950
- } catch(e) {}
951
- var settings = seq.getSettings();
952
- if (!settings) return __error("Could not get sequence settings");
953
- var changed = [];
954
- if (clipFrameRate && settings.videoFrameRate) {
955
- var frTicks = Math.round(TICKS_PER_SECOND / clipFrameRate);
956
- settings.videoFrameRate.ticks = String(frTicks);
957
- changed.push("frameRate=" + clipFrameRate);
958
- }
959
- if (changed.length === 0) {
960
- return __result({
961
- applied: false,
962
- changes: [],
963
- item: item.name,
964
- note: "Could not derive any conformable settings (frame rate) from item '" + item.name + "'. Width/height are not reliably available via scripting; conform those manually via Sequence > Sequence Settings."
965
- });
966
- }
967
- seq.setSettings(settings);
968
- return __result({ applied: true, changes: changed, item: item.name });
931
+ const script = buildToolScript(`
932
+ var itemIndex = ${args.project_item_index};
933
+ if (!app.project) return __error("No project open");
934
+ var rootItem = app.project.rootItem;
935
+ if (!rootItem || !rootItem.children || itemIndex >= rootItem.children.numItems) {
936
+ return __error("Project item index " + itemIndex + " not found");
937
+ }
938
+ var item = rootItem.children[itemIndex];
939
+ var seq = app.project.activeSequence;
940
+ if (!seq) return __error("No active sequence");
941
+ // getVideoMetaData() returns a metadata STRING, not an object with
942
+ // numeric .frameWidth/.frameHeight/.frameRate. Derive the frame rate
943
+ // from the footage interpretation instead, which exposes a numeric
944
+ // .frameRate. Width/height are not reliably available from a project
945
+ // item here, so leave them unchanged.
946
+ var clipFrameRate = null;
947
+ try {
948
+ var interp = item.getFootageInterpretation ? item.getFootageInterpretation() : null;
949
+ if (interp && interp.frameRate) clipFrameRate = interp.frameRate;
950
+ } catch(e) {}
951
+ var settings = seq.getSettings();
952
+ if (!settings) return __error("Could not get sequence settings");
953
+ var changed = [];
954
+ if (clipFrameRate && settings.videoFrameRate) {
955
+ var frTicks = Math.round(TICKS_PER_SECOND / clipFrameRate);
956
+ settings.videoFrameRate.ticks = String(frTicks);
957
+ changed.push("frameRate=" + clipFrameRate);
958
+ }
959
+ if (changed.length === 0) {
960
+ return __result({
961
+ applied: false,
962
+ changes: [],
963
+ item: item.name,
964
+ note: "Could not derive any conformable settings (frame rate) from item '" + item.name + "'. Width/height are not reliably available via scripting; conform those manually via Sequence > Sequence Settings."
965
+ });
966
+ }
967
+ seq.setSettings(settings);
968
+ return __result({ applied: true, changes: changed, item: item.name });
969
969
  `);
970
970
  return sendCommand(script, bridgeOptions);
971
971
  },