@synthetic-ai/premiere-mcp 2.0.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.
- package/CHANGELOG.md +73 -0
- package/LICENSE +21 -0
- package/README.md +242 -0
- package/cep-plugin/.debug +8 -0
- package/cep-plugin/CSInterface.js +70 -0
- package/cep-plugin/CSXS/manifest.xml +49 -0
- package/cep-plugin/host.jsx +7 -0
- package/cep-plugin/index.html +419 -0
- package/cep-plugin/main.js +327 -0
- package/cep-plugin/premiere.jsx +24947 -0
- package/cep-plugin/synthetic-logo.png +0 -0
- package/dist/bridge/file-bridge.d.ts +29 -0
- package/dist/bridge/file-bridge.js +145 -0
- package/dist/bridge/script-builder.d.ts +19 -0
- package/dist/bridge/script-builder.js +408 -0
- package/dist/http-server.d.ts +21 -0
- package/dist/http-server.js +140 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +70 -0
- package/dist/resources/extendscript-reference.d.ts +2 -0
- package/dist/resources/extendscript-reference.js +219 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +276 -0
- package/dist/tools/advanced.d.ts +530 -0
- package/dist/tools/advanced.js +923 -0
- package/dist/tools/audio-advanced.d.ts +847 -0
- package/dist/tools/audio-advanced.js +1653 -0
- package/dist/tools/audio.d.ts +84 -0
- package/dist/tools/audio.js +123 -0
- package/dist/tools/captions.d.ts +30 -0
- package/dist/tools/captions.js +73 -0
- package/dist/tools/clipboard.d.ts +153 -0
- package/dist/tools/clipboard.js +381 -0
- package/dist/tools/color-advanced.d.ts +821 -0
- package/dist/tools/color-advanced.js +772 -0
- package/dist/tools/discovery.d.ts +128 -0
- package/dist/tools/discovery.js +445 -0
- package/dist/tools/effects.d.ts +211 -0
- package/dist/tools/effects.js +554 -0
- package/dist/tools/export-presets.d.ts +333 -0
- package/dist/tools/export-presets.js +490 -0
- package/dist/tools/export.d.ts +320 -0
- package/dist/tools/export.js +618 -0
- package/dist/tools/health.d.ts +9 -0
- package/dist/tools/health.js +25 -0
- package/dist/tools/inspection.d.ts +179 -0
- package/dist/tools/inspection.js +1089 -0
- package/dist/tools/keyframes.d.ts +253 -0
- package/dist/tools/keyframes.js +611 -0
- package/dist/tools/markers.d.ts +117 -0
- package/dist/tools/markers.js +206 -0
- package/dist/tools/media.d.ts +297 -0
- package/dist/tools/media.js +493 -0
- package/dist/tools/metadata.d.ts +178 -0
- package/dist/tools/metadata.js +278 -0
- package/dist/tools/multicam.d.ts +199 -0
- package/dist/tools/multicam.js +212 -0
- package/dist/tools/playback.d.ts +34 -0
- package/dist/tools/playback.js +63 -0
- package/dist/tools/playhead.d.ts +77 -0
- package/dist/tools/playhead.js +185 -0
- package/dist/tools/project-manager.d.ts +65 -0
- package/dist/tools/project-manager.js +81 -0
- package/dist/tools/project.d.ts +390 -0
- package/dist/tools/project.js +596 -0
- package/dist/tools/scripting.d.ts +98 -0
- package/dist/tools/scripting.js +434 -0
- package/dist/tools/selection.d.ts +120 -0
- package/dist/tools/selection.js +334 -0
- package/dist/tools/sequence-advanced.d.ts +84 -0
- package/dist/tools/sequence-advanced.js +471 -0
- package/dist/tools/sequence-settings.d.ts +397 -0
- package/dist/tools/sequence-settings.js +967 -0
- package/dist/tools/sequence.d.ts +211 -0
- package/dist/tools/sequence.js +378 -0
- package/dist/tools/source-monitor.d.ts +95 -0
- package/dist/tools/source-monitor.js +180 -0
- package/dist/tools/text.d.ts +97 -0
- package/dist/tools/text.js +159 -0
- package/dist/tools/timeline.d.ts +265 -0
- package/dist/tools/timeline.js +575 -0
- package/dist/tools/track-management.d.ts +482 -0
- package/dist/tools/track-management.js +787 -0
- package/dist/tools/track-targeting.d.ts +666 -0
- package/dist/tools/track-targeting.js +1318 -0
- package/dist/tools/tracks.d.ts +90 -0
- package/dist/tools/tracks.js +183 -0
- package/dist/tools/transitions-motion.d.ts +788 -0
- package/dist/tools/transitions-motion.js +680 -0
- package/dist/tools/transitions.d.ts +124 -0
- package/dist/tools/transitions.js +267 -0
- package/dist/tools/utility.d.ts +469 -0
- package/dist/tools/utility.js +1118 -0
- package/dist/tools/workspace.d.ts +25 -0
- package/dist/tools/workspace.js +61 -0
- package/package.json +66 -0
- package/scripts/build-chat-dmg.sh +210 -0
- package/scripts/build-chat-zip.sh +291 -0
- package/scripts/install-cep-windows.ps1 +99 -0
- package/scripts/install-cep.sh +66 -0
- package/scripts/install-chat-plugin.bat +67 -0
- package/scripts/install-chat-plugin.sh +85 -0
- package/scripts/install-windows.bat +95 -0
- package/scripts/package.mjs +218 -0
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
import { buildToolScript, escapeForExtendScript } from "../bridge/script-builder.js";
|
|
2
|
+
import { sendCommand } from "../bridge/file-bridge.js";
|
|
3
|
+
export function getProjectTools(bridgeOptions) {
|
|
4
|
+
return {
|
|
5
|
+
save_project: {
|
|
6
|
+
description: "Save the current Premiere Pro project",
|
|
7
|
+
parameters: {},
|
|
8
|
+
handler: async () => {
|
|
9
|
+
const script = buildToolScript(`
|
|
10
|
+
var project = app.project;
|
|
11
|
+
if (!project) return __error("No project is open");
|
|
12
|
+
project.save();
|
|
13
|
+
return __result({ saved: true, name: project.name, path: project.path });
|
|
14
|
+
`);
|
|
15
|
+
return sendCommand(script, bridgeOptions);
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
save_project_as: {
|
|
19
|
+
description: "Save the current project to a new location",
|
|
20
|
+
parameters: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
path: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Full file path to save the project to (e.g., '/Users/me/projects/MyProject.prproj')",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
required: ["path"],
|
|
29
|
+
},
|
|
30
|
+
handler: async (args) => {
|
|
31
|
+
const script = buildToolScript(`
|
|
32
|
+
var project = app.project;
|
|
33
|
+
if (!project) return __error("No project is open");
|
|
34
|
+
project.saveAs("${escapeForExtendScript(args.path)}");
|
|
35
|
+
return __result({ saved: true, path: "${escapeForExtendScript(args.path)}" });
|
|
36
|
+
`);
|
|
37
|
+
return sendCommand(script, bridgeOptions);
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
open_project: {
|
|
41
|
+
description: "Open a Premiere Pro project file",
|
|
42
|
+
parameters: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
path: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Full file path to the .prproj file",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
required: ["path"],
|
|
51
|
+
},
|
|
52
|
+
handler: async (args) => {
|
|
53
|
+
const script = buildToolScript(`
|
|
54
|
+
app.openDocument("${escapeForExtendScript(args.path)}");
|
|
55
|
+
var project = app.project;
|
|
56
|
+
return __result({ opened: true, name: project.name, path: project.path });
|
|
57
|
+
`);
|
|
58
|
+
return sendCommand(script, bridgeOptions);
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
set_active_sequence: {
|
|
62
|
+
description: "Set the active sequence by name or ID",
|
|
63
|
+
parameters: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
sequence_id: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Sequence name or ID to make active",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ["sequence_id"],
|
|
72
|
+
},
|
|
73
|
+
handler: async (args) => {
|
|
74
|
+
const script = buildToolScript(`
|
|
75
|
+
var seq = __findSequence("${escapeForExtendScript(args.sequence_id)}");
|
|
76
|
+
if (!seq) return __error("Sequence not found: ${escapeForExtendScript(args.sequence_id)}");
|
|
77
|
+
app.project.activeSequence = seq;
|
|
78
|
+
return __result({ active: true, name: seq.name, id: seq.sequenceID });
|
|
79
|
+
`);
|
|
80
|
+
return sendCommand(script, bridgeOptions);
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
undo: {
|
|
84
|
+
description: "Undo the last action in Premiere Pro",
|
|
85
|
+
parameters: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {
|
|
88
|
+
count: {
|
|
89
|
+
type: "number",
|
|
90
|
+
description: "Number of times to undo (default: 1)",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
handler: async (args) => {
|
|
95
|
+
const count = args.count || 1;
|
|
96
|
+
const script = buildToolScript(`
|
|
97
|
+
// undo is a QE-DOM operation, not on the Project DOM in most PP builds.
|
|
98
|
+
app.enableQE();
|
|
99
|
+
for (var i = 0; i < ${count}; i++) {
|
|
100
|
+
if (qe && qe.project && qe.project.undo) { qe.project.undo(); }
|
|
101
|
+
else if (app.project.undo) { app.project.undo(); }
|
|
102
|
+
}
|
|
103
|
+
return __result({ undone: ${count} });
|
|
104
|
+
`);
|
|
105
|
+
return sendCommand(script, bridgeOptions);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
consolidate_duplicates: {
|
|
109
|
+
description: "Consolidate duplicate project items",
|
|
110
|
+
parameters: {},
|
|
111
|
+
handler: async () => {
|
|
112
|
+
const script = buildToolScript(`
|
|
113
|
+
app.project.consolidateDuplicates();
|
|
114
|
+
return __result({ consolidated: true });
|
|
115
|
+
`);
|
|
116
|
+
return sendCommand(script, bridgeOptions);
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
create_project: {
|
|
120
|
+
description: "Create a new Premiere Pro project at the specified path",
|
|
121
|
+
parameters: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {
|
|
124
|
+
path: {
|
|
125
|
+
type: "string",
|
|
126
|
+
description: "Full file path for the new .prproj file",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
required: ["path"],
|
|
130
|
+
},
|
|
131
|
+
handler: async (args) => {
|
|
132
|
+
const script = buildToolScript(`
|
|
133
|
+
app.newProject("${escapeForExtendScript(args.path)}");
|
|
134
|
+
var project = app.project;
|
|
135
|
+
if (!project) return __error("Failed to create project");
|
|
136
|
+
return __result({ created: true, name: project.name, path: project.path });
|
|
137
|
+
`);
|
|
138
|
+
return sendCommand(script, bridgeOptions);
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
close_project: {
|
|
142
|
+
description: "Close the current Premiere Pro project",
|
|
143
|
+
parameters: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
save_first: {
|
|
147
|
+
type: "boolean",
|
|
148
|
+
description: "Whether to save before closing (default: true)",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
handler: async (args) => {
|
|
153
|
+
// Default: save before closing. closeDocument(saveFirst, promptUserIfDirty).
|
|
154
|
+
// We always suppress the interactive prompt (promptUser = 0) since this runs
|
|
155
|
+
// headless via the bridge; the saveFirst flag is what actually controls intent.
|
|
156
|
+
const save = args.save_first !== false;
|
|
157
|
+
const script = buildToolScript(`
|
|
158
|
+
var project = app.project;
|
|
159
|
+
if (!project) return __error("No project is open");
|
|
160
|
+
var name = project.name;
|
|
161
|
+
try {
|
|
162
|
+
// saveFirst: ${save ? "1 (save)" : "0 (do not save)"}, promptUserIfDirty: 0 (suppressed)
|
|
163
|
+
project.closeDocument(${save ? "1" : "0"}, 0);
|
|
164
|
+
} catch (e) {
|
|
165
|
+
return __error("Failed to close project: " + e.toString());
|
|
166
|
+
}
|
|
167
|
+
return __result({ closed: true, name: name, saved: ${save} });
|
|
168
|
+
`);
|
|
169
|
+
return sendCommand(script, bridgeOptions);
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
import_ae_comps: {
|
|
173
|
+
description: "Import After Effects compositions from an .aep file",
|
|
174
|
+
parameters: {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {
|
|
177
|
+
ae_project_path: {
|
|
178
|
+
type: "string",
|
|
179
|
+
description: "Full path to the .aep file",
|
|
180
|
+
},
|
|
181
|
+
comp_names: {
|
|
182
|
+
type: "array",
|
|
183
|
+
description: "Array of composition names to import. If omitted, imports all comps.",
|
|
184
|
+
},
|
|
185
|
+
target_bin: {
|
|
186
|
+
type: "string",
|
|
187
|
+
description: "Target bin name or node ID (optional)",
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
required: ["ae_project_path"],
|
|
191
|
+
},
|
|
192
|
+
handler: async (args) => {
|
|
193
|
+
const binLookup = args.target_bin
|
|
194
|
+
? `var targetBin = __findProjectItem("${escapeForExtendScript(args.target_bin)}"); if (!targetBin) return __error("Bin not found");`
|
|
195
|
+
: `var targetBin = app.project.rootItem;`;
|
|
196
|
+
if (args.comp_names && args.comp_names.length > 0) {
|
|
197
|
+
const comps = args.comp_names.map(c => `"${escapeForExtendScript(c)}"`).join(", ");
|
|
198
|
+
const script = buildToolScript(`
|
|
199
|
+
${binLookup}
|
|
200
|
+
app.project.importAEComps("${escapeForExtendScript(args.ae_project_path)}", [${comps}], targetBin);
|
|
201
|
+
return __result({ imported: true, comps: [${comps}] });
|
|
202
|
+
`);
|
|
203
|
+
return sendCommand(script, bridgeOptions);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
const script = buildToolScript(`
|
|
207
|
+
${binLookup}
|
|
208
|
+
app.project.importAllAEComps("${escapeForExtendScript(args.ae_project_path)}", targetBin);
|
|
209
|
+
return __result({ imported: true, allComps: true });
|
|
210
|
+
`);
|
|
211
|
+
return sendCommand(script, bridgeOptions);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
delete_bin: {
|
|
216
|
+
description: "Delete a bin (folder) from the project panel",
|
|
217
|
+
parameters: {
|
|
218
|
+
type: "object",
|
|
219
|
+
properties: {
|
|
220
|
+
bin_id: {
|
|
221
|
+
type: "string",
|
|
222
|
+
description: "Name or node ID of the bin to delete",
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
required: ["bin_id"],
|
|
226
|
+
},
|
|
227
|
+
handler: async (args) => {
|
|
228
|
+
const script = buildToolScript(`
|
|
229
|
+
var bin = __findProjectItem("${escapeForExtendScript(args.bin_id)}");
|
|
230
|
+
if (!bin) return __error("Bin not found: ${escapeForExtendScript(args.bin_id)}");
|
|
231
|
+
if (bin.type !== 2) return __error("Item is not a bin");
|
|
232
|
+
var name = bin.name;
|
|
233
|
+
bin.deleteBin();
|
|
234
|
+
return __result({ deleted: true, name: name });
|
|
235
|
+
`);
|
|
236
|
+
return sendCommand(script, bridgeOptions);
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
rename_bin: {
|
|
240
|
+
description: "Rename a bin (folder) in the project panel",
|
|
241
|
+
parameters: {
|
|
242
|
+
type: "object",
|
|
243
|
+
properties: {
|
|
244
|
+
bin_id: {
|
|
245
|
+
type: "string",
|
|
246
|
+
description: "Name or node ID of the bin to rename",
|
|
247
|
+
},
|
|
248
|
+
new_name: {
|
|
249
|
+
type: "string",
|
|
250
|
+
description: "New name for the bin",
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
required: ["bin_id", "new_name"],
|
|
254
|
+
},
|
|
255
|
+
handler: async (args) => {
|
|
256
|
+
const script = buildToolScript(`
|
|
257
|
+
var bin = __findProjectItem("${escapeForExtendScript(args.bin_id)}");
|
|
258
|
+
if (!bin) return __error("Bin not found: ${escapeForExtendScript(args.bin_id)}");
|
|
259
|
+
if (bin.type !== 2) return __error("Item is not a bin");
|
|
260
|
+
var oldName = bin.name;
|
|
261
|
+
bin.renameBin("${escapeForExtendScript(args.new_name)}");
|
|
262
|
+
return __result({ renamed: true, oldName: oldName, newName: "${escapeForExtendScript(args.new_name)}" });
|
|
263
|
+
`);
|
|
264
|
+
return sendCommand(script, bridgeOptions);
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
create_smart_bin: {
|
|
268
|
+
description: "Create a smart bin (search bin) in the project panel",
|
|
269
|
+
parameters: {
|
|
270
|
+
type: "object",
|
|
271
|
+
properties: {
|
|
272
|
+
name: {
|
|
273
|
+
type: "string",
|
|
274
|
+
description: "Name for the smart bin",
|
|
275
|
+
},
|
|
276
|
+
query: {
|
|
277
|
+
type: "string",
|
|
278
|
+
description: "Search query for the smart bin",
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
required: ["name", "query"],
|
|
282
|
+
},
|
|
283
|
+
handler: async (args) => {
|
|
284
|
+
const script = buildToolScript(`
|
|
285
|
+
app.project.rootItem.createSmartBin("${escapeForExtendScript(args.name)}", "${escapeForExtendScript(args.query)}");
|
|
286
|
+
return __result({ created: true, name: "${escapeForExtendScript(args.name)}", query: "${escapeForExtendScript(args.query)}" });
|
|
287
|
+
`);
|
|
288
|
+
return sendCommand(script, bridgeOptions);
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
find_items_by_media_path: {
|
|
292
|
+
description: "Find project items whose media path contains the given search string",
|
|
293
|
+
parameters: {
|
|
294
|
+
type: "object",
|
|
295
|
+
properties: {
|
|
296
|
+
path_search: {
|
|
297
|
+
type: "string",
|
|
298
|
+
description: "Partial file path to search for",
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
required: ["path_search"],
|
|
302
|
+
},
|
|
303
|
+
handler: async (args) => {
|
|
304
|
+
const script = buildToolScript(`
|
|
305
|
+
var root = app.project.rootItem;
|
|
306
|
+
var matches = root.findItemsMatchingMediaPath("${escapeForExtendScript(args.path_search)}");
|
|
307
|
+
var items = [];
|
|
308
|
+
if (matches) {
|
|
309
|
+
for (var i = 0; i < matches.length; i++) {
|
|
310
|
+
items.push({
|
|
311
|
+
nodeId: matches[i].nodeId,
|
|
312
|
+
name: matches[i].name,
|
|
313
|
+
type: matches[i].type === 1 ? "clip" : matches[i].type === 2 ? "bin" : "sequence"
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return __result({ count: items.length, items: items });
|
|
318
|
+
`);
|
|
319
|
+
return sendCommand(script, bridgeOptions);
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
start_batch_encode: {
|
|
323
|
+
description: "Start encoding all items in the Adobe Media Encoder render queue",
|
|
324
|
+
parameters: {},
|
|
325
|
+
handler: async () => {
|
|
326
|
+
const script = buildToolScript(`
|
|
327
|
+
app.encoder.startBatch();
|
|
328
|
+
return __result({ started: true });
|
|
329
|
+
`);
|
|
330
|
+
return sendCommand(script, bridgeOptions);
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
add_custom_metadata_field: {
|
|
334
|
+
description: "Add a custom metadata field to the project's metadata schema",
|
|
335
|
+
parameters: {
|
|
336
|
+
type: "object",
|
|
337
|
+
properties: {
|
|
338
|
+
field_name: {
|
|
339
|
+
type: "string",
|
|
340
|
+
description: "Internal name for the metadata field",
|
|
341
|
+
},
|
|
342
|
+
field_label: {
|
|
343
|
+
type: "string",
|
|
344
|
+
description: "Display label for the field",
|
|
345
|
+
},
|
|
346
|
+
field_type: {
|
|
347
|
+
type: "number",
|
|
348
|
+
description: "Type of the field: 0 = Integer, 1 = Real, 2 = String, 3 = Boolean",
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
required: ["field_name", "field_label", "field_type"],
|
|
352
|
+
},
|
|
353
|
+
handler: async (args) => {
|
|
354
|
+
const script = buildToolScript(`
|
|
355
|
+
app.project.addPropertyToProjectMetadataSchema("${escapeForExtendScript(args.field_name)}", "${escapeForExtendScript(args.field_label)}", ${args.field_type});
|
|
356
|
+
return __result({ added: true, name: "${escapeForExtendScript(args.field_name)}", label: "${escapeForExtendScript(args.field_label)}" });
|
|
357
|
+
`);
|
|
358
|
+
return sendCommand(script, bridgeOptions);
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
import_sequences: {
|
|
362
|
+
description: "Import sequences from another Premiere Pro project file",
|
|
363
|
+
parameters: {
|
|
364
|
+
type: "object",
|
|
365
|
+
properties: {
|
|
366
|
+
project_path: {
|
|
367
|
+
type: "string",
|
|
368
|
+
description: "Full path to the source .prproj file",
|
|
369
|
+
},
|
|
370
|
+
sequence_ids: {
|
|
371
|
+
type: "array",
|
|
372
|
+
description: "Array of sequence IDs to import from the source project. If omitted, all sequences are imported.",
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
required: ["project_path"],
|
|
376
|
+
},
|
|
377
|
+
handler: async (args) => {
|
|
378
|
+
if (args.sequence_ids && args.sequence_ids.length > 0) {
|
|
379
|
+
const ids = args.sequence_ids.map(id => `"${escapeForExtendScript(id)}"`).join(", ");
|
|
380
|
+
const script = buildToolScript(`
|
|
381
|
+
app.project.importSequences("${escapeForExtendScript(args.project_path)}", [${ids}]);
|
|
382
|
+
return __result({ imported: true, sequenceIds: [${ids}] });
|
|
383
|
+
`);
|
|
384
|
+
return sendCommand(script, bridgeOptions);
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
const script = buildToolScript(`
|
|
388
|
+
app.project.importSequences("${escapeForExtendScript(args.project_path)}");
|
|
389
|
+
return __result({ imported: true, allSequences: true });
|
|
390
|
+
`);
|
|
391
|
+
return sendCommand(script, bridgeOptions);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
create_bars_and_tone: {
|
|
396
|
+
description: "Create a Bars and Tone synthetic media item in the project (useful for leader/calibration)",
|
|
397
|
+
parameters: {
|
|
398
|
+
type: "object",
|
|
399
|
+
properties: {
|
|
400
|
+
width: {
|
|
401
|
+
type: "number",
|
|
402
|
+
description: "Frame width in pixels (default: 1920)",
|
|
403
|
+
},
|
|
404
|
+
height: {
|
|
405
|
+
type: "number",
|
|
406
|
+
description: "Frame height in pixels (default: 1080)",
|
|
407
|
+
},
|
|
408
|
+
timebase: {
|
|
409
|
+
type: "string",
|
|
410
|
+
description: "Timebase as ticks-per-second string (default uses sequence timebase)",
|
|
411
|
+
},
|
|
412
|
+
name: {
|
|
413
|
+
type: "string",
|
|
414
|
+
description: "Name for the bars and tone item (default: 'Bars and Tone')",
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
handler: async (args) => {
|
|
419
|
+
const w = args.width ?? 1920;
|
|
420
|
+
const h = args.height ?? 1080;
|
|
421
|
+
const name = args.name ?? "Bars and Tone";
|
|
422
|
+
const explicitTimebase = args.timebase
|
|
423
|
+
? `"${escapeForExtendScript(args.timebase)}"`
|
|
424
|
+
: "null";
|
|
425
|
+
const script = buildToolScript(`
|
|
426
|
+
try {
|
|
427
|
+
var explicitTimebase = ${explicitTimebase};
|
|
428
|
+
var timebase = explicitTimebase;
|
|
429
|
+
if (timebase === null) {
|
|
430
|
+
// Derive timebase from the active sequence, then any existing sequence,
|
|
431
|
+
// falling back to the standard TICKS_PER_SECOND default only if nothing
|
|
432
|
+
// else is available.
|
|
433
|
+
var seq = app.project.activeSequence;
|
|
434
|
+
if (seq && seq.timebase) {
|
|
435
|
+
timebase = String(seq.timebase);
|
|
436
|
+
} else if (app.project.sequences && app.project.sequences.numSequences > 0) {
|
|
437
|
+
var firstSeq = app.project.sequences[0];
|
|
438
|
+
if (firstSeq && firstSeq.timebase) {
|
|
439
|
+
timebase = String(firstSeq.timebase);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (timebase === null) {
|
|
443
|
+
timebase = String(TICKS_PER_SECOND);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
app.project.newBarsAndTone(${w}, ${h}, timebase, "${escapeForExtendScript(name)}");
|
|
447
|
+
return __result({ created: true, name: "${escapeForExtendScript(name)}", width: ${w}, height: ${h}, timebase: timebase });
|
|
448
|
+
} catch (e) {
|
|
449
|
+
return __error("Failed to create bars and tone: " + e.toString());
|
|
450
|
+
}
|
|
451
|
+
`);
|
|
452
|
+
return sendCommand(script, bridgeOptions);
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
import_fcp_xml: {
|
|
456
|
+
description: "Import a Final Cut Pro XML file into the current project",
|
|
457
|
+
parameters: {
|
|
458
|
+
type: "object",
|
|
459
|
+
properties: {
|
|
460
|
+
path: {
|
|
461
|
+
type: "string",
|
|
462
|
+
description: "Full path to the FCP XML file",
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
required: ["path"],
|
|
466
|
+
},
|
|
467
|
+
handler: async (args) => {
|
|
468
|
+
const script = buildToolScript(`
|
|
469
|
+
app.openFCPXML("${escapeForExtendScript(args.path)}");
|
|
470
|
+
return __result({ imported: true, path: "${escapeForExtendScript(args.path)}" });
|
|
471
|
+
`);
|
|
472
|
+
return sendCommand(script, bridgeOptions);
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
set_transcode_on_ingest: {
|
|
476
|
+
description: "Enable or disable transcoding on ingest for the project",
|
|
477
|
+
parameters: {
|
|
478
|
+
type: "object",
|
|
479
|
+
properties: {
|
|
480
|
+
enabled: {
|
|
481
|
+
type: "boolean",
|
|
482
|
+
description: "True to enable transcode on ingest, false to disable",
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
required: ["enabled"],
|
|
486
|
+
},
|
|
487
|
+
handler: async (args) => {
|
|
488
|
+
const script = buildToolScript(`
|
|
489
|
+
app.project.setEnableTranscodeOnIngest(${args.enabled ? 1 : 0});
|
|
490
|
+
return __result({ set: true, transcodeOnIngest: ${args.enabled} });
|
|
491
|
+
`);
|
|
492
|
+
return sendCommand(script, bridgeOptions);
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
get_insertion_bin: {
|
|
496
|
+
description: "Get the current target bin for new imports (the bin that is currently focused in the Project panel)",
|
|
497
|
+
parameters: {},
|
|
498
|
+
handler: async () => {
|
|
499
|
+
const script = buildToolScript(`
|
|
500
|
+
var bin = app.project.getInsertionBin();
|
|
501
|
+
if (!bin) return __error("No insertion bin found");
|
|
502
|
+
return __result({ name: bin.name, nodeId: bin.nodeId, treePath: bin.treePath });
|
|
503
|
+
`);
|
|
504
|
+
return sendCommand(script, bridgeOptions);
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
get_project_panel_metadata: {
|
|
508
|
+
description: "Get the current project panel metadata/column configuration as XML",
|
|
509
|
+
parameters: {},
|
|
510
|
+
handler: async () => {
|
|
511
|
+
const script = buildToolScript(`
|
|
512
|
+
var meta = app.project.getProjectPanelMetadata();
|
|
513
|
+
if (!meta) return __error("Could not retrieve project panel metadata");
|
|
514
|
+
return __result({ metadata: meta });
|
|
515
|
+
`);
|
|
516
|
+
return sendCommand(script, bridgeOptions);
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
set_project_panel_metadata: {
|
|
520
|
+
description: "Set the project panel metadata/column configuration from XML",
|
|
521
|
+
parameters: {
|
|
522
|
+
type: "object",
|
|
523
|
+
properties: {
|
|
524
|
+
metadata_xml: {
|
|
525
|
+
type: "string",
|
|
526
|
+
description: "XML string containing the project panel metadata configuration",
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
required: ["metadata_xml"],
|
|
530
|
+
},
|
|
531
|
+
handler: async (args) => {
|
|
532
|
+
const script = buildToolScript(`
|
|
533
|
+
app.project.setProjectPanelMetadata("${escapeForExtendScript(args.metadata_xml)}");
|
|
534
|
+
return __result({ set: true });
|
|
535
|
+
`);
|
|
536
|
+
return sendCommand(script, bridgeOptions);
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
get_graphics_white_luminance: {
|
|
540
|
+
description: "Get the graphics white luminance value (HDR setting) for the project",
|
|
541
|
+
parameters: {},
|
|
542
|
+
handler: async () => {
|
|
543
|
+
const script = buildToolScript(`
|
|
544
|
+
var val = app.project.getGraphicsWhiteLuminance();
|
|
545
|
+
return __result({ graphicsWhiteLuminance: val });
|
|
546
|
+
`);
|
|
547
|
+
return sendCommand(script, bridgeOptions);
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
set_graphics_white_luminance: {
|
|
551
|
+
description: "Set the graphics white luminance value (HDR setting) for the project",
|
|
552
|
+
parameters: {
|
|
553
|
+
type: "object",
|
|
554
|
+
properties: {
|
|
555
|
+
luminance: {
|
|
556
|
+
type: "number",
|
|
557
|
+
description: "White luminance value in nits",
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
required: ["luminance"],
|
|
561
|
+
},
|
|
562
|
+
handler: async (args) => {
|
|
563
|
+
const script = buildToolScript(`
|
|
564
|
+
app.project.setGraphicsWhiteLuminance(${args.luminance});
|
|
565
|
+
return __result({ set: true, graphicsWhiteLuminance: ${args.luminance} });
|
|
566
|
+
`);
|
|
567
|
+
return sendCommand(script, bridgeOptions);
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
set_scratch_disk_path: {
|
|
571
|
+
description: "Set the scratch disk path for a specific media type",
|
|
572
|
+
parameters: {
|
|
573
|
+
type: "object",
|
|
574
|
+
properties: {
|
|
575
|
+
scratch_disk_type: {
|
|
576
|
+
type: "string",
|
|
577
|
+
description: "Type: 'capturedVideo', 'capturedAudio', 'videoPreview', 'audioPreview', 'autoSave', 'ccLibraries'",
|
|
578
|
+
},
|
|
579
|
+
path: {
|
|
580
|
+
type: "string",
|
|
581
|
+
description: "Full directory path for the scratch disk",
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
required: ["scratch_disk_type", "path"],
|
|
585
|
+
},
|
|
586
|
+
handler: async (args) => {
|
|
587
|
+
const script = buildToolScript(`
|
|
588
|
+
app.setScratchDiskPath("${escapeForExtendScript(args.path)}", "${escapeForExtendScript(args.scratch_disk_type)}");
|
|
589
|
+
return __result({ set: true, type: "${escapeForExtendScript(args.scratch_disk_type)}", path: "${escapeForExtendScript(args.path)}" });
|
|
590
|
+
`);
|
|
591
|
+
return sendCommand(script, bridgeOptions);
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { BridgeOptions } from "../bridge/file-bridge.js";
|
|
2
|
+
export declare function getScriptingTools(bridgeOptions: BridgeOptions): {
|
|
3
|
+
execute_extendscript: {
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
code: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
timeout_ms: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: string[];
|
|
18
|
+
};
|
|
19
|
+
handler: (args: {
|
|
20
|
+
code: string;
|
|
21
|
+
timeout_ms?: number;
|
|
22
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
23
|
+
};
|
|
24
|
+
evaluate_expression: {
|
|
25
|
+
description: string;
|
|
26
|
+
parameters: {
|
|
27
|
+
type: "object";
|
|
28
|
+
properties: {
|
|
29
|
+
expression: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
required: string[];
|
|
35
|
+
};
|
|
36
|
+
handler: (args: {
|
|
37
|
+
expression: string;
|
|
38
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
39
|
+
};
|
|
40
|
+
inspect_dom_object: {
|
|
41
|
+
description: string;
|
|
42
|
+
parameters: {
|
|
43
|
+
type: "object";
|
|
44
|
+
properties: {
|
|
45
|
+
object_path: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
max_depth: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
required: string[];
|
|
55
|
+
};
|
|
56
|
+
handler: (args: {
|
|
57
|
+
object_path: string;
|
|
58
|
+
max_depth?: number;
|
|
59
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
60
|
+
};
|
|
61
|
+
list_clip_effects: {
|
|
62
|
+
description: string;
|
|
63
|
+
parameters: {
|
|
64
|
+
type: "object";
|
|
65
|
+
properties: {
|
|
66
|
+
node_id: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
required: string[];
|
|
72
|
+
};
|
|
73
|
+
handler: (args: {
|
|
74
|
+
node_id: string;
|
|
75
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
76
|
+
};
|
|
77
|
+
get_sequence_structure: {
|
|
78
|
+
description: string;
|
|
79
|
+
parameters: {
|
|
80
|
+
type: "object";
|
|
81
|
+
properties: {
|
|
82
|
+
sequence_id: {
|
|
83
|
+
type: string;
|
|
84
|
+
description: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
handler: (args: {
|
|
89
|
+
sequence_id?: string;
|
|
90
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
91
|
+
};
|
|
92
|
+
get_premiere_state: {
|
|
93
|
+
description: string;
|
|
94
|
+
parameters: {};
|
|
95
|
+
handler: () => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=scripting.d.ts.map
|