@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,493 @@
|
|
|
1
|
+
import { buildToolScript, escapeForExtendScript } from "../bridge/script-builder.js";
|
|
2
|
+
import { sendCommand } from "../bridge/file-bridge.js";
|
|
3
|
+
export function getMediaTools(bridgeOptions) {
|
|
4
|
+
return {
|
|
5
|
+
import_media: {
|
|
6
|
+
description: `Import one or more media files into the Premiere Pro project panel.
|
|
7
|
+
|
|
8
|
+
Preconditions: A project must be open. File paths must be absolute paths accessible from the machine running Premiere Pro (not the MCP server).
|
|
9
|
+
|
|
10
|
+
After import, use list_project_items to get the node IDs of the imported clips, which are needed for add_to_timeline and other operations.
|
|
11
|
+
|
|
12
|
+
Supported formats: Video (MP4, MOV, MXF, AVI, R3D, BRAW), Audio (WAV, AIFF, MP3, AAC), Images (JPG, PNG, TIFF, PSD), and all other formats Premiere Pro supports.
|
|
13
|
+
|
|
14
|
+
Parameters:
|
|
15
|
+
- file_paths: Array of absolute file paths to import. Use forward slashes on macOS, backslashes on Windows.
|
|
16
|
+
- target_bin: Optional bin name to import into (organize media). If omitted, imports to project root.
|
|
17
|
+
- suppress_ui: Whether to skip import dialogs (default: true — recommended for automation).
|
|
18
|
+
|
|
19
|
+
Example: import_media({ file_paths: ["C:\\\\Media\\\\interview.mp4", "C:\\\\Media\\\\broll.mp4"] })
|
|
20
|
+
Example: import_media({ file_paths: ["/Users/me/footage/clip.mov"], target_bin: "B-Roll" })`,
|
|
21
|
+
parameters: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
file_paths: {
|
|
25
|
+
type: "array",
|
|
26
|
+
items: { type: "string" },
|
|
27
|
+
description: "Array of file paths to import",
|
|
28
|
+
},
|
|
29
|
+
target_bin: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Optional bin name or node ID to import into. Imports to root if omitted.",
|
|
32
|
+
},
|
|
33
|
+
suppress_ui: {
|
|
34
|
+
type: "boolean",
|
|
35
|
+
description: "Suppress import dialogs (default: true)",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ["file_paths"],
|
|
39
|
+
},
|
|
40
|
+
handler: async (args) => {
|
|
41
|
+
const paths = args.file_paths.map((p) => `"${escapeForExtendScript(p)}"`).join(", ");
|
|
42
|
+
const suppress = args.suppress_ui !== false ? "true" : "false";
|
|
43
|
+
const binLookup = args.target_bin
|
|
44
|
+
? `var targetBin = __findProjectItem("${escapeForExtendScript(args.target_bin)}");
|
|
45
|
+
if (!targetBin) return __error("Bin not found: ${escapeForExtendScript(args.target_bin)}");`
|
|
46
|
+
: `var targetBin = app.project.rootItem;`;
|
|
47
|
+
const script = buildToolScript(`
|
|
48
|
+
${binLookup}
|
|
49
|
+
var filePaths = [${paths}];
|
|
50
|
+
// Check which files actually exist before importing
|
|
51
|
+
var existingPaths = [];
|
|
52
|
+
var missingPaths = [];
|
|
53
|
+
for (var i = 0; i < filePaths.length; i++) {
|
|
54
|
+
var f = new File(filePaths[i]);
|
|
55
|
+
if (f.exists) {
|
|
56
|
+
existingPaths.push(filePaths[i]);
|
|
57
|
+
} else {
|
|
58
|
+
missingPaths.push(filePaths[i]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (existingPaths.length === 0) {
|
|
62
|
+
return __error("No files found on disk. Check paths. Missing: " + missingPaths.join(", "));
|
|
63
|
+
}
|
|
64
|
+
var countBefore = targetBin.children ? targetBin.children.numItems : app.project.rootItem.children.numItems;
|
|
65
|
+
var importSuccess = app.project.importFiles(existingPaths, ${suppress}, targetBin, false);
|
|
66
|
+
var countAfter = targetBin.children ? targetBin.children.numItems : app.project.rootItem.children.numItems;
|
|
67
|
+
var actualImported = countAfter - countBefore;
|
|
68
|
+
var result = { imported: actualImported, requested: filePaths.length, files: existingPaths };
|
|
69
|
+
if (missingPaths.length > 0) result.missing = missingPaths;
|
|
70
|
+
if (actualImported === 0 && !importSuccess) return __error("Import failed — Premiere rejected all files");
|
|
71
|
+
return __result(result);
|
|
72
|
+
`);
|
|
73
|
+
return sendCommand(script, bridgeOptions);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
import_folder: {
|
|
77
|
+
description: "Import an entire folder of media into the project",
|
|
78
|
+
parameters: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
folder_path: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Path to the folder to import",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ["folder_path"],
|
|
87
|
+
},
|
|
88
|
+
handler: async (args) => {
|
|
89
|
+
const script = buildToolScript(`
|
|
90
|
+
var folder = new Folder("${escapeForExtendScript(args.folder_path)}");
|
|
91
|
+
if (!folder.exists) return __error("Folder not found: ${escapeForExtendScript(args.folder_path)}");
|
|
92
|
+
|
|
93
|
+
var files = folder.getFiles();
|
|
94
|
+
var filePaths = [];
|
|
95
|
+
for (var i = 0; i < files.length; i++) {
|
|
96
|
+
if (files[i] instanceof File) {
|
|
97
|
+
filePaths.push(files[i].fsName);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (filePaths.length === 0) return __error("No files found in folder");
|
|
102
|
+
|
|
103
|
+
var countBefore = app.project.rootItem.children.numItems;
|
|
104
|
+
var importSuccess = app.project.importFiles(filePaths, true, app.project.rootItem, false);
|
|
105
|
+
var countAfter = app.project.rootItem.children.numItems;
|
|
106
|
+
var actualImported = countAfter - countBefore;
|
|
107
|
+
return __result({ imported: actualImported, requested: filePaths.length, folder: "${escapeForExtendScript(args.folder_path)}" });
|
|
108
|
+
`);
|
|
109
|
+
return sendCommand(script, bridgeOptions);
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
create_bin: {
|
|
113
|
+
description: "Create a new bin (folder) in the project panel",
|
|
114
|
+
parameters: {
|
|
115
|
+
type: "object",
|
|
116
|
+
properties: {
|
|
117
|
+
name: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "Name of the new bin",
|
|
120
|
+
},
|
|
121
|
+
parent_bin: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Optional parent bin name or node ID. Creates in root if omitted.",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ["name"],
|
|
127
|
+
},
|
|
128
|
+
handler: async (args) => {
|
|
129
|
+
const parentLookup = args.parent_bin
|
|
130
|
+
? `var parent = __findProjectItem("${escapeForExtendScript(args.parent_bin)}");
|
|
131
|
+
if (!parent) return __error("Parent bin not found");`
|
|
132
|
+
: `var parent = app.project.rootItem;`;
|
|
133
|
+
const script = buildToolScript(`
|
|
134
|
+
${parentLookup}
|
|
135
|
+
var newBin = parent.createBin("${escapeForExtendScript(args.name)}");
|
|
136
|
+
return __result({ created: true, name: "${escapeForExtendScript(args.name)}", nodeId: newBin.nodeId });
|
|
137
|
+
`);
|
|
138
|
+
return sendCommand(script, bridgeOptions);
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
move_item_to_bin: {
|
|
142
|
+
description: "Move a project item to a different bin",
|
|
143
|
+
parameters: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
item_id: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "Node ID or name of the item to move",
|
|
149
|
+
},
|
|
150
|
+
target_bin: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Name or node ID of the target bin",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
required: ["item_id", "target_bin"],
|
|
156
|
+
},
|
|
157
|
+
handler: async (args) => {
|
|
158
|
+
const script = buildToolScript(`
|
|
159
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
160
|
+
if (!item) return __error("Item not found: ${escapeForExtendScript(args.item_id)}");
|
|
161
|
+
|
|
162
|
+
var targetBin = __findProjectItem("${escapeForExtendScript(args.target_bin)}");
|
|
163
|
+
if (!targetBin) return __error("Target bin not found: ${escapeForExtendScript(args.target_bin)}");
|
|
164
|
+
|
|
165
|
+
item.moveBin(targetBin);
|
|
166
|
+
return __result({ moved: true, item: item.name, toBin: targetBin.name });
|
|
167
|
+
`);
|
|
168
|
+
return sendCommand(script, bridgeOptions);
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
relink_media: {
|
|
172
|
+
description: "Relink an offline media item to a new file path",
|
|
173
|
+
parameters: {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: {
|
|
176
|
+
item_id: {
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "Node ID or name of the item to relink",
|
|
179
|
+
},
|
|
180
|
+
new_path: {
|
|
181
|
+
type: "string",
|
|
182
|
+
description: "New file path for the media",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
required: ["item_id", "new_path"],
|
|
186
|
+
},
|
|
187
|
+
handler: async (args) => {
|
|
188
|
+
const script = buildToolScript(`
|
|
189
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
190
|
+
if (!item) return __error("Item not found: ${escapeForExtendScript(args.item_id)}");
|
|
191
|
+
|
|
192
|
+
var success = item.changeMediaPath("${escapeForExtendScript(args.new_path)}", true);
|
|
193
|
+
return __result({ relinked: success, item: item.name, newPath: "${escapeForExtendScript(args.new_path)}" });
|
|
194
|
+
`);
|
|
195
|
+
return sendCommand(script, bridgeOptions);
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
refresh_media: {
|
|
199
|
+
description: "Refresh a project item to pick up changes to the source file",
|
|
200
|
+
parameters: {
|
|
201
|
+
type: "object",
|
|
202
|
+
properties: {
|
|
203
|
+
item_id: {
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "Node ID or name of the item to refresh",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
required: ["item_id"],
|
|
209
|
+
},
|
|
210
|
+
handler: async (args) => {
|
|
211
|
+
const script = buildToolScript(`
|
|
212
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
213
|
+
if (!item) return __error("Item not found: ${escapeForExtendScript(args.item_id)}");
|
|
214
|
+
item.refreshMedia();
|
|
215
|
+
return __result({ refreshed: true, item: item.name });
|
|
216
|
+
`);
|
|
217
|
+
return sendCommand(script, bridgeOptions);
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
check_offline_media: {
|
|
221
|
+
description: "Check for offline (missing) media in the project",
|
|
222
|
+
parameters: {},
|
|
223
|
+
handler: async () => {
|
|
224
|
+
const script = buildToolScript(`
|
|
225
|
+
var offlineItems = [];
|
|
226
|
+
|
|
227
|
+
function checkItem(item) {
|
|
228
|
+
if (item.type === 1) {
|
|
229
|
+
try {
|
|
230
|
+
if (__readMaybe(item, "isOffline", false)) {
|
|
231
|
+
offlineItems.push({
|
|
232
|
+
nodeId: item.nodeId,
|
|
233
|
+
name: item.name,
|
|
234
|
+
mediaPath: item.getMediaPath ? item.getMediaPath() : ""
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
} catch(e) {}
|
|
238
|
+
}
|
|
239
|
+
if (item.type === 2 && item.children) {
|
|
240
|
+
for (var i = 0; i < item.children.numItems; i++) {
|
|
241
|
+
checkItem(item.children[i]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
var root = app.project.rootItem;
|
|
247
|
+
for (var i = 0; i < root.children.numItems; i++) {
|
|
248
|
+
checkItem(root.children[i]);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return __result({ offlineCount: offlineItems.length, items: offlineItems });
|
|
252
|
+
`);
|
|
253
|
+
return sendCommand(script, bridgeOptions);
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
set_offline: {
|
|
257
|
+
description: "Set a project item to offline status (unlinks its media)",
|
|
258
|
+
parameters: {
|
|
259
|
+
type: "object",
|
|
260
|
+
properties: {
|
|
261
|
+
item_id: {
|
|
262
|
+
type: "string",
|
|
263
|
+
description: "Node ID or name of the project item",
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
required: ["item_id"],
|
|
267
|
+
},
|
|
268
|
+
handler: async (args) => {
|
|
269
|
+
const script = buildToolScript(`
|
|
270
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
271
|
+
if (!item) return __error("Item not found: ${escapeForExtendScript(args.item_id)}");
|
|
272
|
+
item.setOffline();
|
|
273
|
+
return __result({ offline: true, item: item.name });
|
|
274
|
+
`);
|
|
275
|
+
return sendCommand(script, bridgeOptions);
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
has_proxy: {
|
|
279
|
+
description: "Check if a project item has a proxy attached",
|
|
280
|
+
parameters: {
|
|
281
|
+
type: "object",
|
|
282
|
+
properties: {
|
|
283
|
+
item_id: {
|
|
284
|
+
type: "string",
|
|
285
|
+
description: "Node ID or name of the project item",
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
required: ["item_id"],
|
|
289
|
+
},
|
|
290
|
+
handler: async (args) => {
|
|
291
|
+
const script = buildToolScript(`
|
|
292
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
293
|
+
if (!item) return __error("Item not found");
|
|
294
|
+
|
|
295
|
+
var info = { item: item.name };
|
|
296
|
+
try { info.hasProxy = item.hasProxy(); } catch(e) { info.hasProxy = false; }
|
|
297
|
+
try { info.canProxy = item.canProxy(); } catch(e) { info.canProxy = false; }
|
|
298
|
+
try { info.proxyPath = item.getProxyPath(); } catch(e) {}
|
|
299
|
+
|
|
300
|
+
return __result(info);
|
|
301
|
+
`);
|
|
302
|
+
return sendCommand(script, bridgeOptions);
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
detach_proxy: {
|
|
306
|
+
description: "Detach/remove the proxy from a project item",
|
|
307
|
+
parameters: {
|
|
308
|
+
type: "object",
|
|
309
|
+
properties: {
|
|
310
|
+
item_id: {
|
|
311
|
+
type: "string",
|
|
312
|
+
description: "Node ID or name of the project item",
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
required: ["item_id"],
|
|
316
|
+
},
|
|
317
|
+
handler: async (args) => {
|
|
318
|
+
const script = buildToolScript(`
|
|
319
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
320
|
+
if (!item) return __error("Item not found");
|
|
321
|
+
item.detachProxy();
|
|
322
|
+
return __result({ detached: true, item: item.name });
|
|
323
|
+
`);
|
|
324
|
+
return sendCommand(script, bridgeOptions);
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
set_override_frame_rate: {
|
|
328
|
+
description: "Override the frame rate of a project item (useful for image sequences or misinterpreted media)",
|
|
329
|
+
parameters: {
|
|
330
|
+
type: "object",
|
|
331
|
+
properties: {
|
|
332
|
+
item_id: {
|
|
333
|
+
type: "string",
|
|
334
|
+
description: "Node ID or name of the project item",
|
|
335
|
+
},
|
|
336
|
+
frame_rate: {
|
|
337
|
+
type: "number",
|
|
338
|
+
description: "Frame rate to set (e.g., 23.976, 24, 29.97, 30, 60)",
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
required: ["item_id", "frame_rate"],
|
|
342
|
+
},
|
|
343
|
+
handler: async (args) => {
|
|
344
|
+
const script = buildToolScript(`
|
|
345
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
346
|
+
if (!item) return __error("Item not found");
|
|
347
|
+
item.setOverrideFrameRate(${args.frame_rate});
|
|
348
|
+
return __result({ set: true, item: item.name, frameRate: ${args.frame_rate} });
|
|
349
|
+
`);
|
|
350
|
+
return sendCommand(script, bridgeOptions);
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
set_override_pixel_aspect_ratio: {
|
|
354
|
+
description: "Override the pixel aspect ratio of a project item",
|
|
355
|
+
parameters: {
|
|
356
|
+
type: "object",
|
|
357
|
+
properties: {
|
|
358
|
+
item_id: {
|
|
359
|
+
type: "string",
|
|
360
|
+
description: "Node ID or name of the project item",
|
|
361
|
+
},
|
|
362
|
+
numerator: {
|
|
363
|
+
type: "number",
|
|
364
|
+
description: "PAR numerator (e.g., 1 for square pixels)",
|
|
365
|
+
},
|
|
366
|
+
denominator: {
|
|
367
|
+
type: "number",
|
|
368
|
+
description: "PAR denominator (e.g., 1 for square pixels)",
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
required: ["item_id", "numerator", "denominator"],
|
|
372
|
+
},
|
|
373
|
+
handler: async (args) => {
|
|
374
|
+
const script = buildToolScript(`
|
|
375
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
376
|
+
if (!item) return __error("Item not found");
|
|
377
|
+
item.setOverridePixelAspectRatio(${args.numerator}, ${args.denominator});
|
|
378
|
+
return __result({ set: true, item: item.name, par: "${args.numerator}:${args.denominator}" });
|
|
379
|
+
`);
|
|
380
|
+
return sendCommand(script, bridgeOptions);
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
set_scale_to_frame_size: {
|
|
384
|
+
description: "Enable 'Scale to Frame Size' on a project item so it fills the sequence frame",
|
|
385
|
+
parameters: {
|
|
386
|
+
type: "object",
|
|
387
|
+
properties: {
|
|
388
|
+
item_id: {
|
|
389
|
+
type: "string",
|
|
390
|
+
description: "Node ID or name of the project item",
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
required: ["item_id"],
|
|
394
|
+
},
|
|
395
|
+
handler: async (args) => {
|
|
396
|
+
const script = buildToolScript(`
|
|
397
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
398
|
+
if (!item) return __error("Item not found");
|
|
399
|
+
item.setScaleToFrameSize();
|
|
400
|
+
return __result({ set: true, item: item.name });
|
|
401
|
+
`);
|
|
402
|
+
return sendCommand(script, bridgeOptions);
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
get_item_info: {
|
|
406
|
+
description: "Get detailed type info about a project item (is it a sequence, multicam, merged clip, etc.)",
|
|
407
|
+
parameters: {
|
|
408
|
+
type: "object",
|
|
409
|
+
properties: {
|
|
410
|
+
item_id: {
|
|
411
|
+
type: "string",
|
|
412
|
+
description: "Node ID or name of the project item",
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
required: ["item_id"],
|
|
416
|
+
},
|
|
417
|
+
handler: async (args) => {
|
|
418
|
+
const script = buildToolScript(`
|
|
419
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
420
|
+
if (!item) return __error("Item not found");
|
|
421
|
+
|
|
422
|
+
var info = {
|
|
423
|
+
name: item.name,
|
|
424
|
+
nodeId: item.nodeId,
|
|
425
|
+
type: item.type === 1 ? "clip" : item.type === 2 ? "bin" : item.type === 3 ? "sequence" : "unknown",
|
|
426
|
+
treePath: item.treePath
|
|
427
|
+
};
|
|
428
|
+
info.isSequence = __readMaybe(item, "isSequence", false);
|
|
429
|
+
info.isMulticamClip = __readMaybe(item, "isMulticamClip", false);
|
|
430
|
+
info.isMergedClip = __readMaybe(item, "isMergedClip", false);
|
|
431
|
+
info.isOffline = __readMaybe(item, "isOffline", false);
|
|
432
|
+
try { info.mediaPath = item.getMediaPath(); } catch(e) {}
|
|
433
|
+
try { info.hasProxy = item.hasProxy(); } catch(e) {}
|
|
434
|
+
try { info.canProxy = item.canProxy(); } catch(e) {}
|
|
435
|
+
|
|
436
|
+
return __result(info);
|
|
437
|
+
`);
|
|
438
|
+
return sendCommand(script, bridgeOptions);
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
select_item: {
|
|
442
|
+
description: "Select a project item in the Project panel",
|
|
443
|
+
parameters: {
|
|
444
|
+
type: "object",
|
|
445
|
+
properties: {
|
|
446
|
+
item_id: {
|
|
447
|
+
type: "string",
|
|
448
|
+
description: "Node ID or name of the project item to select",
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
required: ["item_id"],
|
|
452
|
+
},
|
|
453
|
+
handler: async (args) => {
|
|
454
|
+
const script = buildToolScript(`
|
|
455
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
456
|
+
if (!item) return __error("Item not found");
|
|
457
|
+
item.select();
|
|
458
|
+
return __result({ selected: true, item: item.name });
|
|
459
|
+
`);
|
|
460
|
+
return sendCommand(script, bridgeOptions);
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
set_start_time: {
|
|
464
|
+
description: "Set the start time (timecode offset) for a project item",
|
|
465
|
+
parameters: {
|
|
466
|
+
type: "object",
|
|
467
|
+
properties: {
|
|
468
|
+
item_id: {
|
|
469
|
+
type: "string",
|
|
470
|
+
description: "Node ID or name of the project item",
|
|
471
|
+
},
|
|
472
|
+
start_seconds: {
|
|
473
|
+
type: "number",
|
|
474
|
+
description: "Start time in seconds",
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
required: ["item_id", "start_seconds"],
|
|
478
|
+
},
|
|
479
|
+
handler: async (args) => {
|
|
480
|
+
const script = buildToolScript(`
|
|
481
|
+
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
|
482
|
+
if (!item) return __error("Item not found");
|
|
483
|
+
|
|
484
|
+
var ticks = __secondsToTicks(${args.start_seconds}).toString();
|
|
485
|
+
item.setStartTime(ticks);
|
|
486
|
+
return __result({ set: true, item: item.name, startSeconds: ${args.start_seconds} });
|
|
487
|
+
`);
|
|
488
|
+
return sendCommand(script, bridgeOptions);
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { BridgeOptions } from "../bridge/file-bridge.js";
|
|
2
|
+
export declare function getMetadataTools(bridgeOptions: BridgeOptions): {
|
|
3
|
+
get_metadata: {
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
item_id: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
required: string[];
|
|
14
|
+
};
|
|
15
|
+
handler: (args: {
|
|
16
|
+
item_id: string;
|
|
17
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
18
|
+
};
|
|
19
|
+
set_metadata: {
|
|
20
|
+
description: string;
|
|
21
|
+
parameters: {
|
|
22
|
+
type: "object";
|
|
23
|
+
properties: {
|
|
24
|
+
item_id: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
field_name: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
value: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
required: string[];
|
|
38
|
+
};
|
|
39
|
+
handler: (args: {
|
|
40
|
+
item_id: string;
|
|
41
|
+
field_name: string;
|
|
42
|
+
value: string;
|
|
43
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
44
|
+
};
|
|
45
|
+
set_color_label: {
|
|
46
|
+
description: string;
|
|
47
|
+
parameters: {
|
|
48
|
+
type: "object";
|
|
49
|
+
properties: {
|
|
50
|
+
item_id: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
color_index: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
required: string[];
|
|
60
|
+
};
|
|
61
|
+
handler: (args: {
|
|
62
|
+
item_id: string;
|
|
63
|
+
color_index: number;
|
|
64
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
65
|
+
};
|
|
66
|
+
get_color_label: {
|
|
67
|
+
description: string;
|
|
68
|
+
parameters: {
|
|
69
|
+
type: "object";
|
|
70
|
+
properties: {
|
|
71
|
+
item_id: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
required: string[];
|
|
77
|
+
};
|
|
78
|
+
handler: (args: {
|
|
79
|
+
item_id: string;
|
|
80
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
81
|
+
};
|
|
82
|
+
get_footage_interpretation: {
|
|
83
|
+
description: string;
|
|
84
|
+
parameters: {
|
|
85
|
+
type: "object";
|
|
86
|
+
properties: {
|
|
87
|
+
item_id: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
required: string[];
|
|
93
|
+
};
|
|
94
|
+
handler: (args: {
|
|
95
|
+
item_id: string;
|
|
96
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
97
|
+
};
|
|
98
|
+
set_footage_interpretation: {
|
|
99
|
+
description: string;
|
|
100
|
+
parameters: {
|
|
101
|
+
type: "object";
|
|
102
|
+
properties: {
|
|
103
|
+
item_id: {
|
|
104
|
+
type: string;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
107
|
+
frame_rate: {
|
|
108
|
+
type: string;
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
pixel_aspect_ratio: {
|
|
112
|
+
type: string;
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
required: string[];
|
|
117
|
+
};
|
|
118
|
+
handler: (args: {
|
|
119
|
+
item_id: string;
|
|
120
|
+
frame_rate?: number;
|
|
121
|
+
pixel_aspect_ratio?: number;
|
|
122
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
123
|
+
};
|
|
124
|
+
get_xmp_metadata: {
|
|
125
|
+
description: string;
|
|
126
|
+
parameters: {
|
|
127
|
+
type: "object";
|
|
128
|
+
properties: {
|
|
129
|
+
item_id: {
|
|
130
|
+
type: string;
|
|
131
|
+
description: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
required: string[];
|
|
135
|
+
};
|
|
136
|
+
handler: (args: {
|
|
137
|
+
item_id: string;
|
|
138
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
139
|
+
};
|
|
140
|
+
set_xmp_metadata: {
|
|
141
|
+
description: string;
|
|
142
|
+
parameters: {
|
|
143
|
+
type: "object";
|
|
144
|
+
properties: {
|
|
145
|
+
item_id: {
|
|
146
|
+
type: string;
|
|
147
|
+
description: string;
|
|
148
|
+
};
|
|
149
|
+
xmp_xml: {
|
|
150
|
+
type: string;
|
|
151
|
+
description: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
required: string[];
|
|
155
|
+
};
|
|
156
|
+
handler: (args: {
|
|
157
|
+
item_id: string;
|
|
158
|
+
xmp_xml: string;
|
|
159
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
160
|
+
};
|
|
161
|
+
get_color_space: {
|
|
162
|
+
description: string;
|
|
163
|
+
parameters: {
|
|
164
|
+
type: "object";
|
|
165
|
+
properties: {
|
|
166
|
+
item_id: {
|
|
167
|
+
type: string;
|
|
168
|
+
description: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
required: string[];
|
|
172
|
+
};
|
|
173
|
+
handler: (args: {
|
|
174
|
+
item_id: string;
|
|
175
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=metadata.d.ts.map
|