@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,434 @@
|
|
|
1
|
+
import { buildToolScript, escapeForExtendScript } from "../bridge/script-builder.js";
|
|
2
|
+
import { sendCommand, sendRawCommand } from "../bridge/file-bridge.js";
|
|
3
|
+
export function getScriptingTools(bridgeOptions) {
|
|
4
|
+
return {
|
|
5
|
+
execute_extendscript: {
|
|
6
|
+
description: `Execute custom ExtendScript code in Premiere Pro. The code runs inside an IIFE with helper functions available.
|
|
7
|
+
|
|
8
|
+
IMPORTANT: You MUST write ES3 syntax (var instead of let/const, no arrow functions, no template literals, no destructuring).
|
|
9
|
+
|
|
10
|
+
Available helpers (auto-prepended):
|
|
11
|
+
- __ticksToSeconds(ticks) / __secondsToTicks(seconds) — time conversion
|
|
12
|
+
- __ticksToTimecode(ticks, fps) — timecode string
|
|
13
|
+
- __findSequence(idOrName) — find sequence by name or ID
|
|
14
|
+
- __findProjectItem(nodeIdOrName) — find project item recursively
|
|
15
|
+
- __findClip(nodeId) — find clip in active sequence, returns {clip, trackIndex, clipIndex, trackType}
|
|
16
|
+
- __getAllClips(seq) — get all clips in a sequence
|
|
17
|
+
- __result(data) — return success with data (MUST call this or __error)
|
|
18
|
+
- __error(msg) — return error message
|
|
19
|
+
- TICKS_PER_SECOND — constant 254016000000
|
|
20
|
+
- app.enableQE() — enable QE DOM access
|
|
21
|
+
|
|
22
|
+
Your code MUST end with: return __result({...}) or return __error("message")
|
|
23
|
+
|
|
24
|
+
Example: Set opacity to 50% on all video clips
|
|
25
|
+
var seq = app.project.activeSequence;
|
|
26
|
+
if (!seq) return __error("No active sequence");
|
|
27
|
+
var count = 0;
|
|
28
|
+
for (var t = 0; t < seq.videoTracks.numTracks; t++) {
|
|
29
|
+
var track = seq.videoTracks[t];
|
|
30
|
+
for (var c = 0; c < track.clips.numItems; c++) {
|
|
31
|
+
var clip = track.clips[c];
|
|
32
|
+
for (var i = 0; i < clip.components.numItems; i++) {
|
|
33
|
+
var comp = clip.components[i];
|
|
34
|
+
if (comp.displayName === "Opacity") {
|
|
35
|
+
for (var p = 0; p < comp.properties.numItems; p++) {
|
|
36
|
+
if (comp.properties[p].displayName === "Opacity") {
|
|
37
|
+
comp.properties[p].setValue(50, true);
|
|
38
|
+
count++;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return __result({updated: count});`,
|
|
46
|
+
parameters: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
code: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "ExtendScript code to execute (ES3 syntax). Must use return __result({...}) or return __error('...'). Helpers are auto-prepended.",
|
|
52
|
+
},
|
|
53
|
+
timeout_ms: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Custom timeout in milliseconds (default: 30000). Increase for long operations.",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ["code"],
|
|
59
|
+
},
|
|
60
|
+
handler: async (args) => {
|
|
61
|
+
const script = buildToolScript(args.code);
|
|
62
|
+
const opts = { ...bridgeOptions };
|
|
63
|
+
if (args.timeout_ms) {
|
|
64
|
+
opts.timeoutMs = args.timeout_ms;
|
|
65
|
+
}
|
|
66
|
+
return sendRawCommand(script, opts);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
evaluate_expression: {
|
|
70
|
+
description: `Evaluate a simple ExtendScript expression and return its value. Use for quick queries like checking a property, getting a count, or reading state. The expression should be a single value/call — NOT a full script.
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
- "app.project.name" → project name
|
|
74
|
+
- "app.project.activeSequence.name" → active sequence name
|
|
75
|
+
- "app.project.rootItem.children.numItems" → number of root items
|
|
76
|
+
- "app.project.activeSequence.videoTracks.numTracks" → number of video tracks
|
|
77
|
+
- "app.version" → Premiere Pro version`,
|
|
78
|
+
parameters: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
expression: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "ExtendScript expression to evaluate (e.g., 'app.project.name')",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ["expression"],
|
|
87
|
+
},
|
|
88
|
+
handler: async (args) => {
|
|
89
|
+
const script = buildToolScript(`
|
|
90
|
+
try {
|
|
91
|
+
var val = ${args.expression};
|
|
92
|
+
return __result({ value: val, type: typeof val });
|
|
93
|
+
} catch(e) {
|
|
94
|
+
return __error("Expression error: " + e.toString());
|
|
95
|
+
}
|
|
96
|
+
`);
|
|
97
|
+
return sendRawCommand(script, bridgeOptions);
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
inspect_dom_object: {
|
|
101
|
+
description: `Inspect a Premiere Pro DOM object and list its properties, methods, and values. Useful for exploring the API and debugging.
|
|
102
|
+
|
|
103
|
+
Examples:
|
|
104
|
+
- "app.project" → project properties
|
|
105
|
+
- "app.project.activeSequence" → sequence properties
|
|
106
|
+
- "app.project.activeSequence.videoTracks[0].clips[0]" → first clip on V1
|
|
107
|
+
- "app.project.activeSequence.videoTracks[0].clips[0].components[0]" → first component of a clip`,
|
|
108
|
+
parameters: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
object_path: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Dot-path to the DOM object to inspect (e.g., 'app.project.activeSequence')",
|
|
114
|
+
},
|
|
115
|
+
max_depth: {
|
|
116
|
+
type: "number",
|
|
117
|
+
description: "Max depth for nested inspection (default: 1, max: 3)",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
required: ["object_path"],
|
|
121
|
+
},
|
|
122
|
+
handler: async (args) => {
|
|
123
|
+
const maxDepth = Math.min(args.max_depth ?? 1, 3);
|
|
124
|
+
const script = buildToolScript(`
|
|
125
|
+
function inspectObj(obj, depth, maxD) {
|
|
126
|
+
if (depth > maxD) return "<max depth>";
|
|
127
|
+
if (obj === null) return null;
|
|
128
|
+
if (obj === undefined) return undefined;
|
|
129
|
+
var t = typeof obj;
|
|
130
|
+
if (t === "string" || t === "number" || t === "boolean") return obj;
|
|
131
|
+
|
|
132
|
+
var result = {};
|
|
133
|
+
var propCount = 0;
|
|
134
|
+
try {
|
|
135
|
+
for (var key in obj) {
|
|
136
|
+
if (propCount > 50) {
|
|
137
|
+
result["__truncated"] = true;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
var val = obj[key];
|
|
142
|
+
var vt = typeof val;
|
|
143
|
+
if (vt === "function") {
|
|
144
|
+
result[key] = "[function]";
|
|
145
|
+
} else if (vt === "object" && val !== null) {
|
|
146
|
+
if (depth < maxD) {
|
|
147
|
+
result[key] = inspectObj(val, depth + 1, maxD);
|
|
148
|
+
} else {
|
|
149
|
+
result[key] = "[object]";
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
result[key] = val;
|
|
153
|
+
}
|
|
154
|
+
} catch(e) {
|
|
155
|
+
result[key] = "[error: " + e.toString() + "]";
|
|
156
|
+
}
|
|
157
|
+
propCount++;
|
|
158
|
+
}
|
|
159
|
+
} catch(e) {
|
|
160
|
+
return { __error: e.toString() };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Also try common collection properties
|
|
164
|
+
try { if (obj.numItems !== undefined) result["numItems"] = obj.numItems; } catch(e) {}
|
|
165
|
+
try { if (obj.numTracks !== undefined) result["numTracks"] = obj.numTracks; } catch(e) {}
|
|
166
|
+
try { if (obj.numSequences !== undefined) result["numSequences"] = obj.numSequences; } catch(e) {}
|
|
167
|
+
try { if (obj.length !== undefined) result["length"] = obj.length; } catch(e) {}
|
|
168
|
+
try { if (obj.name !== undefined) result["name"] = obj.name; } catch(e) {}
|
|
169
|
+
try { if (obj.displayName !== undefined) result["displayName"] = obj.displayName; } catch(e) {}
|
|
170
|
+
try { if (obj.matchName !== undefined) result["matchName"] = obj.matchName; } catch(e) {}
|
|
171
|
+
try { if (obj.nodeId !== undefined) result["nodeId"] = obj.nodeId; } catch(e) {}
|
|
172
|
+
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
try {
|
|
177
|
+
var obj = ${args.object_path};
|
|
178
|
+
if (obj === null || obj === undefined) return __error("Object is null or undefined: ${args.object_path}");
|
|
179
|
+
var inspection = inspectObj(obj, 0, ${maxDepth});
|
|
180
|
+
return __result({
|
|
181
|
+
path: "${args.object_path}",
|
|
182
|
+
type: typeof obj,
|
|
183
|
+
inspection: inspection
|
|
184
|
+
});
|
|
185
|
+
} catch(e) {
|
|
186
|
+
return __error("Cannot access: ${args.object_path} — " + e.toString());
|
|
187
|
+
}
|
|
188
|
+
`);
|
|
189
|
+
return sendRawCommand(script, bridgeOptions);
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
list_clip_effects: {
|
|
193
|
+
description: "List all effects/components on a clip with their properties and current values. Essential for debugging effect issues.",
|
|
194
|
+
parameters: {
|
|
195
|
+
type: "object",
|
|
196
|
+
properties: {
|
|
197
|
+
node_id: {
|
|
198
|
+
type: "string",
|
|
199
|
+
description: "Node ID of the clip to inspect",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
required: ["node_id"],
|
|
203
|
+
},
|
|
204
|
+
handler: async (args) => {
|
|
205
|
+
const script = buildToolScript(`
|
|
206
|
+
var result = __findClip("${escapeForExtendScript(args.node_id)}");
|
|
207
|
+
if (!result) return __error("Clip not found: ${escapeForExtendScript(args.node_id)}");
|
|
208
|
+
|
|
209
|
+
var clip = result.clip;
|
|
210
|
+
var components = [];
|
|
211
|
+
|
|
212
|
+
for (var i = 0; i < clip.components.numItems; i++) {
|
|
213
|
+
var comp = clip.components[i];
|
|
214
|
+
var props = [];
|
|
215
|
+
for (var p = 0; p < comp.properties.numItems; p++) {
|
|
216
|
+
var prop = comp.properties[p];
|
|
217
|
+
var info = {
|
|
218
|
+
index: p,
|
|
219
|
+
displayName: prop.displayName,
|
|
220
|
+
matchName: ""
|
|
221
|
+
};
|
|
222
|
+
try { info.matchName = prop.matchName; } catch(e) {}
|
|
223
|
+
try { info.value = prop.getValue(0, 0); } catch(e) {}
|
|
224
|
+
try { info.isTimeVarying = prop.isTimeVarying(); } catch(e) {}
|
|
225
|
+
try { info.keyframesSupported = prop.areKeyframesSupported(); } catch(e) {}
|
|
226
|
+
props.push(info);
|
|
227
|
+
}
|
|
228
|
+
components.push({
|
|
229
|
+
index: i,
|
|
230
|
+
displayName: comp.displayName,
|
|
231
|
+
matchName: comp.matchName,
|
|
232
|
+
properties: props
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return __result({
|
|
237
|
+
clipName: clip.name,
|
|
238
|
+
nodeId: clip.nodeId,
|
|
239
|
+
trackType: result.trackType,
|
|
240
|
+
trackIndex: result.trackIndex,
|
|
241
|
+
componentCount: components.length,
|
|
242
|
+
components: components
|
|
243
|
+
});
|
|
244
|
+
`);
|
|
245
|
+
return sendCommand(script, bridgeOptions);
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
get_sequence_structure: {
|
|
249
|
+
description: "Get a complete structural overview of the active sequence: all tracks, all clips with positions, gaps, and clip metadata. Essential for understanding timeline state before making edits.",
|
|
250
|
+
parameters: {
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: {
|
|
253
|
+
sequence_id: {
|
|
254
|
+
type: "string",
|
|
255
|
+
description: "Sequence name or ID. Uses active sequence if omitted.",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
handler: async (args) => {
|
|
260
|
+
const seqLookup = args.sequence_id
|
|
261
|
+
? `var seq = __findSequence("${args.sequence_id}"); if (!seq) return __error("Sequence not found");`
|
|
262
|
+
: `var seq = app.project.activeSequence; if (!seq) return __error("No active sequence");`;
|
|
263
|
+
const script = buildToolScript(`
|
|
264
|
+
${seqLookup}
|
|
265
|
+
|
|
266
|
+
var videoTracks = [];
|
|
267
|
+
for (var t = 0; t < seq.videoTracks.numTracks; t++) {
|
|
268
|
+
var track = seq.videoTracks[t];
|
|
269
|
+
var clips = [];
|
|
270
|
+
for (var c = 0; c < track.clips.numItems; c++) {
|
|
271
|
+
var clip = track.clips[c];
|
|
272
|
+
var clipInfo = {
|
|
273
|
+
index: c,
|
|
274
|
+
nodeId: clip.nodeId,
|
|
275
|
+
name: clip.name,
|
|
276
|
+
startSeconds: __ticksToSeconds(clip.start.ticks),
|
|
277
|
+
endSeconds: __ticksToSeconds(clip.end.ticks),
|
|
278
|
+
durationSeconds: __ticksToSeconds(clip.duration.ticks),
|
|
279
|
+
inPointSeconds: __ticksToSeconds(clip.inPoint.ticks),
|
|
280
|
+
outPointSeconds: __ticksToSeconds(clip.outPoint.ticks),
|
|
281
|
+
mediaType: clip.mediaType,
|
|
282
|
+
enabled: true
|
|
283
|
+
};
|
|
284
|
+
try { clipInfo.enabled = !clip.isDisabled(); } catch(e) {}
|
|
285
|
+
try { clipInfo.speed = clip.getSpeed(); } catch(e) {}
|
|
286
|
+
clips.push(clipInfo);
|
|
287
|
+
}
|
|
288
|
+
videoTracks.push({
|
|
289
|
+
index: t,
|
|
290
|
+
name: track.name,
|
|
291
|
+
clipCount: clips.length,
|
|
292
|
+
clips: clips,
|
|
293
|
+
isMuted: track.isMuted(),
|
|
294
|
+
isLocked: track.isLocked()
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var audioTracks = [];
|
|
299
|
+
for (var t = 0; t < seq.audioTracks.numTracks; t++) {
|
|
300
|
+
var track = seq.audioTracks[t];
|
|
301
|
+
var clips = [];
|
|
302
|
+
for (var c = 0; c < track.clips.numItems; c++) {
|
|
303
|
+
var clip = track.clips[c];
|
|
304
|
+
clips.push({
|
|
305
|
+
index: c,
|
|
306
|
+
nodeId: clip.nodeId,
|
|
307
|
+
name: clip.name,
|
|
308
|
+
startSeconds: __ticksToSeconds(clip.start.ticks),
|
|
309
|
+
endSeconds: __ticksToSeconds(clip.end.ticks),
|
|
310
|
+
durationSeconds: __ticksToSeconds(clip.duration.ticks),
|
|
311
|
+
inPointSeconds: __ticksToSeconds(clip.inPoint.ticks),
|
|
312
|
+
outPointSeconds: __ticksToSeconds(clip.outPoint.ticks),
|
|
313
|
+
mediaType: clip.mediaType
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
audioTracks.push({
|
|
317
|
+
index: t,
|
|
318
|
+
name: track.name,
|
|
319
|
+
clipCount: clips.length,
|
|
320
|
+
clips: clips,
|
|
321
|
+
isMuted: track.isMuted(),
|
|
322
|
+
isLocked: track.isLocked()
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return __result({
|
|
327
|
+
name: seq.name,
|
|
328
|
+
id: seq.sequenceID,
|
|
329
|
+
durationSeconds: __ticksToSeconds(seq.end),
|
|
330
|
+
videoTrackCount: videoTracks.length,
|
|
331
|
+
audioTrackCount: audioTracks.length,
|
|
332
|
+
videoTracks: videoTracks,
|
|
333
|
+
audioTracks: audioTracks
|
|
334
|
+
});
|
|
335
|
+
`);
|
|
336
|
+
return sendCommand(script, bridgeOptions);
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
get_premiere_state: {
|
|
340
|
+
description: "Get a comprehensive snapshot of the current Premiere Pro state: project info, active sequence, playhead position, selected clips, and available sequences. The best first call to understand the current context.",
|
|
341
|
+
parameters: {},
|
|
342
|
+
handler: async () => {
|
|
343
|
+
const script = buildToolScript(`
|
|
344
|
+
var state = {};
|
|
345
|
+
|
|
346
|
+
// Project info
|
|
347
|
+
var project = app.project;
|
|
348
|
+
if (!project) return __error("No project is open");
|
|
349
|
+
state.project = {
|
|
350
|
+
name: project.name,
|
|
351
|
+
path: project.path,
|
|
352
|
+
rootItemCount: project.rootItem.children.numItems,
|
|
353
|
+
sequenceCount: project.sequences.numSequences
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
// List all sequences
|
|
357
|
+
state.sequences = [];
|
|
358
|
+
for (var i = 0; i < project.sequences.numSequences; i++) {
|
|
359
|
+
var seq = project.sequences[i];
|
|
360
|
+
var seqDuration = null;
|
|
361
|
+
try {
|
|
362
|
+
if (seq.end != null) {
|
|
363
|
+
seqDuration = __ticksToSeconds(seq.end);
|
|
364
|
+
}
|
|
365
|
+
} catch(e) { seqDuration = null; }
|
|
366
|
+
state.sequences.push({
|
|
367
|
+
name: seq.name,
|
|
368
|
+
id: seq.sequenceID,
|
|
369
|
+
duration: seqDuration
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Active sequence
|
|
374
|
+
var active = project.activeSequence;
|
|
375
|
+
if (active) {
|
|
376
|
+
var activeDuration = null;
|
|
377
|
+
try {
|
|
378
|
+
if (active.end != null) {
|
|
379
|
+
activeDuration = __ticksToSeconds(active.end);
|
|
380
|
+
}
|
|
381
|
+
} catch(e) { activeDuration = null; }
|
|
382
|
+
state.activeSequence = {
|
|
383
|
+
name: active.name,
|
|
384
|
+
id: active.sequenceID,
|
|
385
|
+
durationSeconds: activeDuration,
|
|
386
|
+
videoTrackCount: active.videoTracks.numTracks,
|
|
387
|
+
audioTrackCount: active.audioTracks.numTracks
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// Playhead
|
|
391
|
+
try {
|
|
392
|
+
var playerPos = active.getPlayerPosition();
|
|
393
|
+
state.playheadSeconds = __ticksToSeconds(playerPos.ticks);
|
|
394
|
+
} catch(e) {}
|
|
395
|
+
|
|
396
|
+
// Selected clips
|
|
397
|
+
try {
|
|
398
|
+
var sel = active.getSelection();
|
|
399
|
+
state.selectedClips = [];
|
|
400
|
+
for (var i = 0; i < sel.length; i++) {
|
|
401
|
+
state.selectedClips.push({
|
|
402
|
+
nodeId: sel[i].nodeId,
|
|
403
|
+
name: sel[i].name
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
} catch(e) {
|
|
407
|
+
state.selectedClips = [];
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Quick clip count
|
|
411
|
+
var totalClips = 0;
|
|
412
|
+
for (var t = 0; t < active.videoTracks.numTracks; t++) {
|
|
413
|
+
totalClips += active.videoTracks[t].clips.numItems;
|
|
414
|
+
}
|
|
415
|
+
for (var t = 0; t < active.audioTracks.numTracks; t++) {
|
|
416
|
+
totalClips += active.audioTracks[t].clips.numItems;
|
|
417
|
+
}
|
|
418
|
+
state.activeSequence.totalClipCount = totalClips;
|
|
419
|
+
} else {
|
|
420
|
+
state.activeSequence = null;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Premiere version
|
|
424
|
+
try { state.version = app.version; } catch(e) {}
|
|
425
|
+
try { state.buildNumber = app.build; } catch(e) {}
|
|
426
|
+
|
|
427
|
+
return __result(state);
|
|
428
|
+
`);
|
|
429
|
+
return sendCommand(script, bridgeOptions);
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
//# sourceMappingURL=scripting.js.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { BridgeOptions } from "../bridge/file-bridge.js";
|
|
2
|
+
export declare function getSelectionTools(bridgeOptions: BridgeOptions): {
|
|
3
|
+
select_clips_by_name: {
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
name: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
track_type: {
|
|
13
|
+
type: string;
|
|
14
|
+
enum: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
track_index: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
add_to_selection: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
};
|
|
28
|
+
handler: (args: {
|
|
29
|
+
name: string;
|
|
30
|
+
track_type?: string;
|
|
31
|
+
track_index?: number;
|
|
32
|
+
add_to_selection?: boolean;
|
|
33
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
34
|
+
};
|
|
35
|
+
select_all_clips: {
|
|
36
|
+
description: string;
|
|
37
|
+
parameters: {
|
|
38
|
+
type: "object";
|
|
39
|
+
properties: {
|
|
40
|
+
track_type: {
|
|
41
|
+
type: string;
|
|
42
|
+
enum: string[];
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
track_index: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
handler: (args: {
|
|
52
|
+
track_type?: string;
|
|
53
|
+
track_index?: number;
|
|
54
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
55
|
+
};
|
|
56
|
+
deselect_all_clips: {
|
|
57
|
+
description: string;
|
|
58
|
+
parameters: {};
|
|
59
|
+
handler: () => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
60
|
+
};
|
|
61
|
+
select_clips_in_range: {
|
|
62
|
+
description: string;
|
|
63
|
+
parameters: {
|
|
64
|
+
type: "object";
|
|
65
|
+
properties: {
|
|
66
|
+
start_seconds: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
end_seconds: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
track_type: {
|
|
75
|
+
type: string;
|
|
76
|
+
enum: string[];
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
track_index: {
|
|
80
|
+
type: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
required: string[];
|
|
85
|
+
};
|
|
86
|
+
handler: (args: {
|
|
87
|
+
start_seconds: number;
|
|
88
|
+
end_seconds: number;
|
|
89
|
+
track_type?: string;
|
|
90
|
+
track_index?: number;
|
|
91
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
92
|
+
};
|
|
93
|
+
select_clips_by_color: {
|
|
94
|
+
description: string;
|
|
95
|
+
parameters: {
|
|
96
|
+
type: "object";
|
|
97
|
+
properties: {
|
|
98
|
+
color_index: {
|
|
99
|
+
type: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
required: string[];
|
|
104
|
+
};
|
|
105
|
+
handler: (args: {
|
|
106
|
+
color_index: number;
|
|
107
|
+
}) => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
108
|
+
};
|
|
109
|
+
invert_selection: {
|
|
110
|
+
description: string;
|
|
111
|
+
parameters: {};
|
|
112
|
+
handler: () => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
113
|
+
};
|
|
114
|
+
select_disabled_clips: {
|
|
115
|
+
description: string;
|
|
116
|
+
parameters: {};
|
|
117
|
+
handler: () => Promise<import("../bridge/file-bridge.js").CommandResult>;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=selection.d.ts.map
|