premiere-cli 0.2.0__py3-none-any.whl

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 (247) hide show
  1. premiere_cli/__init__.py +11 -0
  2. premiere_cli/cli.py +3664 -0
  3. premiere_cli/log.py +66 -0
  4. premiere_cli/panel/.debug +8 -0
  5. premiere_cli/panel/CSXS/manifest.xml +52 -0
  6. premiere_cli/panel/css/style.css +53 -0
  7. premiere_cli/panel/host/commands/add-adjustment-layer.jsx +190 -0
  8. premiere_cli/panel/host/commands/add-audio-keyframes.jsx +176 -0
  9. premiere_cli/panel/host/commands/add-custom-metadata-field.jsx +63 -0
  10. premiere_cli/panel/host/commands/add-keyframe.jsx +181 -0
  11. premiere_cli/panel/host/commands/add-marker-to-project-item.jsx +194 -0
  12. premiere_cli/panel/host/commands/add-marker.jsx +129 -0
  13. premiere_cli/panel/host/commands/add-text-overlay.jsx +101 -0
  14. premiere_cli/panel/host/commands/add-to-render-queue.jsx +120 -0
  15. premiere_cli/panel/host/commands/add-to-timeline.jsx +300 -0
  16. premiere_cli/panel/host/commands/add-track.jsx +188 -0
  17. premiere_cli/panel/host/commands/add-transition.jsx +134 -0
  18. premiere_cli/panel/host/commands/adjust-audio-levels.jsx +132 -0
  19. premiere_cli/panel/host/commands/apply-audio-effect.jsx +118 -0
  20. premiere_cli/panel/host/commands/apply-effect.jsx +122 -0
  21. premiere_cli/panel/host/commands/apply-lut.jsx +107 -0
  22. premiere_cli/panel/host/commands/attach-custom-property.jsx +66 -0
  23. premiere_cli/panel/host/commands/auto-reframe-sequence.jsx +124 -0
  24. premiere_cli/panel/host/commands/batch-add-transitions.jsx +158 -0
  25. premiere_cli/panel/host/commands/batch-apply-effect.jsx +182 -0
  26. premiere_cli/panel/host/commands/batch-rename-clips.jsx +170 -0
  27. premiere_cli/panel/host/commands/batch-set-clips-enabled.jsx +145 -0
  28. premiere_cli/panel/host/commands/clear-item-in-out.jsx +117 -0
  29. premiere_cli/panel/host/commands/clear-sequence-in-out.jsx +100 -0
  30. premiere_cli/panel/host/commands/close-all-source-clips.jsx +32 -0
  31. premiere_cli/panel/host/commands/close-sequence.jsx +80 -0
  32. premiere_cli/panel/host/commands/close-source-monitor.jsx +32 -0
  33. premiere_cli/panel/host/commands/color-correct.jsx +164 -0
  34. premiere_cli/panel/host/commands/copy-effect-values.jsx +183 -0
  35. premiere_cli/panel/host/commands/copy-effects-between-clips.jsx +234 -0
  36. premiere_cli/panel/host/commands/create-bars-and-tone.jsx +152 -0
  37. premiere_cli/panel/host/commands/create-bin.jsx +76 -0
  38. premiere_cli/panel/host/commands/create-caption-track.jsx +159 -0
  39. premiere_cli/panel/host/commands/create-sequence-from-clips.jsx +170 -0
  40. premiere_cli/panel/host/commands/create-sequence-from-preset.jsx +90 -0
  41. premiere_cli/panel/host/commands/create-sequence.jsx +166 -0
  42. premiere_cli/panel/host/commands/create-smart-bin.jsx +80 -0
  43. premiere_cli/panel/host/commands/create-subclip.jsx +248 -0
  44. premiere_cli/panel/host/commands/create-subsequence.jsx +136 -0
  45. premiere_cli/panel/host/commands/debug-qe-inspect.jsx +248 -0
  46. premiere_cli/panel/host/commands/debug-qe-try-mutate.jsx +305 -0
  47. premiere_cli/panel/host/commands/delete-marker.jsx +178 -0
  48. premiere_cli/panel/host/commands/deselect-all-clips.jsx +98 -0
  49. premiere_cli/panel/host/commands/detach-proxy.jsx +116 -0
  50. premiere_cli/panel/host/commands/duplicate-clip.jsx +140 -0
  51. premiere_cli/panel/host/commands/duplicate-sequence.jsx +150 -0
  52. premiere_cli/panel/host/commands/encode-file.jsx +86 -0
  53. premiere_cli/panel/host/commands/encode-project-item.jsx +145 -0
  54. premiere_cli/panel/host/commands/export-aaf.jsx +77 -0
  55. premiere_cli/panel/host/commands/export-fcp-xml.jsx +65 -0
  56. premiere_cli/panel/host/commands/export-frame.jsx +381 -0
  57. premiere_cli/panel/host/commands/export-omf.jsx +95 -0
  58. premiere_cli/panel/host/commands/export-sequence-as-project.jsx +65 -0
  59. premiere_cli/panel/host/commands/export-sequence.jsx +100 -0
  60. premiere_cli/panel/host/commands/extract-audio-track.jsx +181 -0
  61. premiere_cli/panel/host/commands/extract-selection.jsx +113 -0
  62. premiere_cli/panel/host/commands/find-items-by-media-path.jsx +112 -0
  63. premiere_cli/panel/host/commands/freeze-frame.jsx +215 -0
  64. premiere_cli/panel/host/commands/get-active-sequence.jsx +103 -0
  65. premiere_cli/panel/host/commands/get-all-project-paths.jsx +72 -0
  66. premiere_cli/panel/host/commands/get-bin-contents.jsx +176 -0
  67. premiere_cli/panel/host/commands/get-clip-adjustment-layer.jsx +83 -0
  68. premiere_cli/panel/host/commands/get-clip-at-playhead.jsx +99 -0
  69. premiere_cli/panel/host/commands/get-clip-at-position.jsx +120 -0
  70. premiere_cli/panel/host/commands/get-clip-links.jsx +135 -0
  71. premiere_cli/panel/host/commands/get-clip-markers.jsx +144 -0
  72. premiere_cli/panel/host/commands/get-clip-speed.jsx +69 -0
  73. premiere_cli/panel/host/commands/get-color-label.jsx +89 -0
  74. premiere_cli/panel/host/commands/get-color-space.jsx +99 -0
  75. premiere_cli/panel/host/commands/get-duplicate-media.jsx +78 -0
  76. premiere_cli/panel/host/commands/get-effect-properties.jsx +129 -0
  77. premiere_cli/panel/host/commands/get-encoder-presets.jsx +131 -0
  78. premiere_cli/panel/host/commands/get-export-file-extension.jsx +56 -0
  79. premiere_cli/panel/host/commands/get-footage-interpretation.jsx +113 -0
  80. premiere_cli/panel/host/commands/get-full-clip-info.jsx +162 -0
  81. premiere_cli/panel/host/commands/get-full-project-overview.jsx +193 -0
  82. premiere_cli/panel/host/commands/get-full-sequence-info.jsx +184 -0
  83. premiere_cli/panel/host/commands/get-graphics-white-luminance.jsx +31 -0
  84. premiere_cli/panel/host/commands/get-insertion-bin.jsx +35 -0
  85. premiere_cli/panel/host/commands/get-item-metadata.jsx +94 -0
  86. premiere_cli/panel/host/commands/get-keyframes.jsx +158 -0
  87. premiere_cli/panel/host/commands/get-mogrt-component.jsx +111 -0
  88. premiere_cli/panel/host/commands/get-next-edit-point.jsx +131 -0
  89. premiere_cli/panel/host/commands/get-offline-media.jsx +67 -0
  90. premiere_cli/panel/host/commands/get-open-projects.jsx +50 -0
  91. premiere_cli/panel/host/commands/get-premiere-state.jsx +164 -0
  92. premiere_cli/panel/host/commands/get-project-info.jsx +63 -0
  93. premiere_cli/panel/host/commands/get-project-item-info.jsx +247 -0
  94. premiere_cli/panel/host/commands/get-project-panel-metadata.jsx +30 -0
  95. premiere_cli/panel/host/commands/get-qe-clip-info.jsx +198 -0
  96. premiere_cli/panel/host/commands/get-render-queue-status.jsx +35 -0
  97. premiere_cli/panel/host/commands/get-sequence-count.jsx +24 -0
  98. premiere_cli/panel/host/commands/get-sequence-in-out.jsx +76 -0
  99. premiere_cli/panel/host/commands/get-sequence-markers-by-type.jsx +89 -0
  100. premiere_cli/panel/host/commands/get-source-monitor-info.jsx +34 -0
  101. premiere_cli/panel/host/commands/get-source-monitor-position.jsx +30 -0
  102. premiere_cli/panel/host/commands/get-target-tracks.jsx +76 -0
  103. premiere_cli/panel/host/commands/get-timeline-gaps.jsx +124 -0
  104. premiere_cli/panel/host/commands/get-timeline-summary.jsx +154 -0
  105. premiere_cli/panel/host/commands/get-total-clip-count.jsx +67 -0
  106. premiere_cli/panel/host/commands/get-track-info.jsx +117 -0
  107. premiere_cli/panel/host/commands/get-unused-media.jsx +99 -0
  108. premiere_cli/panel/host/commands/get-used-media-report.jsx +125 -0
  109. premiere_cli/panel/host/commands/get-value-at-time.jsx +135 -0
  110. premiere_cli/panel/host/commands/get-version-info.jsx +33 -0
  111. premiere_cli/panel/host/commands/get-work-area.jsx +52 -0
  112. premiere_cli/panel/host/commands/get-workspaces.jsx +29 -0
  113. premiere_cli/panel/host/commands/get-xmp-metadata.jsx +107 -0
  114. premiere_cli/panel/host/commands/import-ae-comps.jsx +129 -0
  115. premiere_cli/panel/host/commands/import-fcp-xml.jsx +103 -0
  116. premiere_cli/panel/host/commands/import-folder.jsx +193 -0
  117. premiere_cli/panel/host/commands/import-image-sequence.jsx +171 -0
  118. premiere_cli/panel/host/commands/import-media.jsx +217 -0
  119. premiere_cli/panel/host/commands/import-mogrt-from-library.jsx +105 -0
  120. premiere_cli/panel/host/commands/import-mogrt.jsx +111 -0
  121. premiere_cli/panel/host/commands/import-sequences-from-project.jsx +80 -0
  122. premiere_cli/panel/host/commands/insert-from-source.jsx +162 -0
  123. premiere_cli/panel/host/commands/inspect-dom-object.jsx +162 -0
  124. premiere_cli/panel/host/commands/invert-selection.jsx +114 -0
  125. premiere_cli/panel/host/commands/is-work-area-enabled.jsx +88 -0
  126. premiere_cli/panel/host/commands/lift-selection.jsx +106 -0
  127. premiere_cli/panel/host/commands/link-selection.jsx +111 -0
  128. premiere_cli/panel/host/commands/list-available-audio-effects.jsx +33 -0
  129. premiere_cli/panel/host/commands/list-available-audio-transitions.jsx +35 -0
  130. premiere_cli/panel/host/commands/list-available-effects.jsx +33 -0
  131. premiere_cli/panel/host/commands/list-available-transitions.jsx +74 -0
  132. premiere_cli/panel/host/commands/list-markers.jsx +69 -0
  133. premiere_cli/panel/host/commands/list-project-items.jsx +105 -0
  134. premiere_cli/panel/host/commands/lock-track.jsx +114 -0
  135. premiere_cli/panel/host/commands/manage-proxies.jsx +176 -0
  136. premiere_cli/panel/host/commands/match-frame.jsx +141 -0
  137. premiere_cli/panel/host/commands/move-clip-to-track.jsx +220 -0
  138. premiere_cli/panel/host/commands/move-clip.jsx +97 -0
  139. premiere_cli/panel/host/commands/move-items-to-bin.jsx +194 -0
  140. premiere_cli/panel/host/commands/move-playhead-to-edit.jsx +174 -0
  141. premiere_cli/panel/host/commands/move-playhead.jsx +137 -0
  142. premiere_cli/panel/host/commands/nest-clips.jsx +179 -0
  143. premiere_cli/panel/host/commands/open-in-source.jsx +117 -0
  144. premiere_cli/panel/host/commands/open-project.jsx +61 -0
  145. premiere_cli/panel/host/commands/overwrite-clip-at.jsx +350 -0
  146. premiere_cli/panel/host/commands/overwrite-from-source.jsx +150 -0
  147. premiere_cli/panel/host/commands/play-source-monitor.jsx +36 -0
  148. premiere_cli/panel/host/commands/play-timeline.jsx +24 -0
  149. premiere_cli/panel/host/commands/razor-all-tracks.jsx +171 -0
  150. premiere_cli/panel/host/commands/redo.jsx +69 -0
  151. premiere_cli/panel/host/commands/refresh-media.jsx +101 -0
  152. premiere_cli/panel/host/commands/relink-media.jsx +132 -0
  153. premiere_cli/panel/host/commands/remove-all-effects.jsx +114 -0
  154. premiere_cli/panel/host/commands/remove-effect-by-name.jsx +143 -0
  155. premiere_cli/panel/host/commands/remove-effect.jsx +122 -0
  156. premiere_cli/panel/host/commands/remove-from-timeline.jsx +93 -0
  157. premiere_cli/panel/host/commands/remove-keyframe-range.jsx +173 -0
  158. premiere_cli/panel/host/commands/remove-keyframe.jsx +192 -0
  159. premiere_cli/panel/host/commands/remove-selected-clips.jsx +126 -0
  160. premiere_cli/panel/host/commands/remove-track-intervals.jsx +254 -0
  161. premiere_cli/panel/host/commands/remove-transition.jsx +164 -0
  162. premiere_cli/panel/host/commands/rename-bin.jsx +88 -0
  163. premiere_cli/panel/host/commands/rename-clip.jsx +127 -0
  164. premiere_cli/panel/host/commands/rename-project-item.jsx +111 -0
  165. premiere_cli/panel/host/commands/rename-track.jsx +84 -0
  166. premiere_cli/panel/host/commands/replace-clip-media.jsx +140 -0
  167. premiere_cli/panel/host/commands/replace-clip.jsx +188 -0
  168. premiere_cli/panel/host/commands/reverse-clip.jsx +187 -0
  169. premiere_cli/panel/host/commands/ripple-delete-clip.jsx +156 -0
  170. premiere_cli/panel/host/commands/roll-edit.jsx +162 -0
  171. premiere_cli/panel/host/commands/save-project-as.jsx +55 -0
  172. premiere_cli/panel/host/commands/save-project.jsx +57 -0
  173. premiere_cli/panel/host/commands/scene-edit-detection.jsx +128 -0
  174. premiere_cli/panel/host/commands/search-project-items.jsx +180 -0
  175. premiere_cli/panel/host/commands/select-all-clips.jsx +107 -0
  176. premiere_cli/panel/host/commands/select-clips-by-color.jsx +142 -0
  177. premiere_cli/panel/host/commands/select-clips-by-name.jsx +133 -0
  178. premiere_cli/panel/host/commands/select-clips-in-range.jsx +133 -0
  179. premiere_cli/panel/host/commands/select-disabled-clips.jsx +127 -0
  180. premiere_cli/panel/host/commands/select-project-item.jsx +115 -0
  181. premiere_cli/panel/host/commands/set-active-project.jsx +184 -0
  182. premiere_cli/panel/host/commands/set-active-sequence.jsx +87 -0
  183. premiere_cli/panel/host/commands/set-all-tracks-targeted.jsx +112 -0
  184. premiere_cli/panel/host/commands/set-anti-alias-quality.jsx +125 -0
  185. premiere_cli/panel/host/commands/set-blend-mode.jsx +111 -0
  186. premiere_cli/panel/host/commands/set-clip-anchor-point.jsx +102 -0
  187. premiere_cli/panel/host/commands/set-clip-enabled.jsx +127 -0
  188. premiere_cli/panel/host/commands/set-clip-opacity.jsx +102 -0
  189. premiere_cli/panel/host/commands/set-clip-pan.jsx +107 -0
  190. premiere_cli/panel/host/commands/set-clip-position.jsx +103 -0
  191. premiere_cli/panel/host/commands/set-clip-properties.jsx +221 -0
  192. premiere_cli/panel/host/commands/set-clip-rotation.jsx +102 -0
  193. premiere_cli/panel/host/commands/set-clip-scale.jsx +102 -0
  194. premiere_cli/panel/host/commands/set-clip-selection.jsx +144 -0
  195. premiere_cli/panel/host/commands/set-clip-speed.jsx +160 -0
  196. premiere_cli/panel/host/commands/set-clip-volume.jsx +128 -0
  197. premiere_cli/panel/host/commands/set-color-label.jsx +123 -0
  198. premiere_cli/panel/host/commands/set-color-value.jsx +155 -0
  199. premiere_cli/panel/host/commands/set-effect-property.jsx +124 -0
  200. premiere_cli/panel/host/commands/set-footage-interpretation.jsx +173 -0
  201. premiere_cli/panel/host/commands/set-frame-blend.jsx +145 -0
  202. premiere_cli/panel/host/commands/set-graphics-white-luminance.jsx +73 -0
  203. premiere_cli/panel/host/commands/set-item-in-out.jsx +180 -0
  204. premiere_cli/panel/host/commands/set-item-metadata.jsx +134 -0
  205. premiere_cli/panel/host/commands/set-item-offline.jsx +109 -0
  206. premiere_cli/panel/host/commands/set-item-start-time.jsx +139 -0
  207. premiere_cli/panel/host/commands/set-keyframe-interpolation.jsx +186 -0
  208. premiere_cli/panel/host/commands/set-override-frame-rate.jsx +123 -0
  209. premiere_cli/panel/host/commands/set-override-pixel-aspect-ratio.jsx +129 -0
  210. premiere_cli/panel/host/commands/set-poster-frame.jsx +192 -0
  211. premiere_cli/panel/host/commands/set-project-panel-metadata.jsx +69 -0
  212. premiere_cli/panel/host/commands/set-scale-to-frame-size.jsx +101 -0
  213. premiere_cli/panel/host/commands/set-scale-width-height.jsx +140 -0
  214. premiere_cli/panel/host/commands/set-sequence-in-out.jsx +65 -0
  215. premiere_cli/panel/host/commands/set-sequence-settings.jsx +184 -0
  216. premiere_cli/panel/host/commands/set-source-in-out.jsx +98 -0
  217. premiere_cli/panel/host/commands/set-target-track.jsx +91 -0
  218. premiere_cli/panel/host/commands/set-time-interpolation.jsx +141 -0
  219. premiere_cli/panel/host/commands/set-track-mute.jsx +91 -0
  220. premiere_cli/panel/host/commands/set-track-visibility.jsx +94 -0
  221. premiere_cli/panel/host/commands/set-transcode-on-ingest.jsx +78 -0
  222. premiere_cli/panel/host/commands/set-uniform-scale.jsx +104 -0
  223. premiere_cli/panel/host/commands/set-work-area.jsx +76 -0
  224. premiere_cli/panel/host/commands/set-workspace.jsx +35 -0
  225. premiere_cli/panel/host/commands/set-xmp-metadata.jsx +157 -0
  226. premiere_cli/panel/host/commands/slide-edit.jsx +162 -0
  227. premiere_cli/panel/host/commands/slip-edit.jsx +167 -0
  228. premiere_cli/panel/host/commands/split-clip.jsx +144 -0
  229. premiere_cli/panel/host/commands/stabilize-clip.jsx +139 -0
  230. premiere_cli/panel/host/commands/stop-playback.jsx +23 -0
  231. premiere_cli/panel/host/commands/trim-clip.jsx +111 -0
  232. premiere_cli/panel/host/commands/undo.jsx +114 -0
  233. premiere_cli/panel/host/commands/unlink-selection.jsx +106 -0
  234. premiere_cli/panel/host/commands/unnest-sequence.jsx +207 -0
  235. premiere_cli/panel/host/commands/update-marker.jsx +120 -0
  236. premiere_cli/panel/host/index.jsx +1227 -0
  237. premiere_cli/panel/host/presets/default-4k-25fps.sqpreset +63 -0
  238. premiere_cli/panel/index.html +16 -0
  239. premiere_cli/panel/js/cs-interface.js +11 -0
  240. premiere_cli/panel/js/main.js +409 -0
  241. premiere_cli/panel_install.py +220 -0
  242. premiere_cli-0.2.0.dist-info/METADATA +127 -0
  243. premiere_cli-0.2.0.dist-info/RECORD +247 -0
  244. premiere_cli-0.2.0.dist-info/WHEEL +5 -0
  245. premiere_cli-0.2.0.dist-info/entry_points.txt +3 -0
  246. premiere_cli-0.2.0.dist-info/licenses/LICENSE +428 -0
  247. premiere_cli-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,111 @@
1
+ // Command: get-mogrt-component → ppb_getMogrtComponent
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — findSequenceByName,
4
+ // resolveTimelineClip are already defined there.
5
+ //
6
+ // Ported from leancoderkavy's premiere-pro-mcp advanced.ts
7
+ // get_mogrt_component, re-addressed to this panel's
8
+ // trackType/trackIndex/clipIndex convention (same as get-full-clip-info)
9
+ // instead of node_id. READ-ONLY — properties are serialized the same
10
+ // shape as get-effect-properties ({displayName, value, isTimeVarying,
11
+ // keyCount}).
12
+ //
13
+ // ⚠️ Per PREMIERE_API_NOTES.md's "MOGRT Source Text format" note, a
14
+ // MOGRT's Source Text property value is a 4-byte binary header + JSON
15
+ // (mTextParam structure) — plain getValue() returns that raw blob, not
16
+ // human-readable text. This command does NOT attempt to strip the header
17
+ // or parse the JSON (that's a write-path concern per the reference
18
+ // project's hard-won notes, and this command never writes) — the raw
19
+ // value is reported as-is; callers wanting the actual displayed text need
20
+ // to decode it client-side.
21
+ function ppb_getMogrtComponent(argsJson) {
22
+ try {
23
+ var args;
24
+ try {
25
+ args = JSON.parse(argsJson);
26
+ } catch (e) {
27
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
28
+ }
29
+
30
+ if (args.trackType !== "video" && args.trackType !== "audio") {
31
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
32
+ }
33
+ if (typeof args.trackIndex !== "number" || typeof args.clipIndex !== "number") {
34
+ return JSON.stringify({ ok: false, error: "trackIndex and clipIndex are required" });
35
+ }
36
+
37
+ if (!app.project) {
38
+ return JSON.stringify({ ok: false, error: "no project open" });
39
+ }
40
+
41
+ var seq = null;
42
+ if (args.sequenceName && typeof args.sequenceName === "string") {
43
+ seq = findSequenceByName(args.sequenceName);
44
+ if (!seq) {
45
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
46
+ }
47
+ } else {
48
+ seq = app.project.activeSequence;
49
+ if (!seq) {
50
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
51
+ }
52
+ }
53
+
54
+ var resolved = resolveTimelineClip(seq, args.trackType, args.trackIndex, args.clipIndex);
55
+ if (resolved.error) {
56
+ return JSON.stringify({ ok: false, error: resolved.error });
57
+ }
58
+ var clip = resolved.clip;
59
+ var clipName = null;
60
+ try { clipName = clip.name; } catch (e2) { clipName = null; }
61
+
62
+ var mgtComp = null;
63
+ try {
64
+ mgtComp = clip.getMGTComponent();
65
+ } catch (e3) {
66
+ return JSON.stringify({ ok: false, error: "clip.getMGTComponent() failed: " + e3.toString() });
67
+ }
68
+ if (!mgtComp) {
69
+ return JSON.stringify({ ok: false, error: "not a MOGRT clip, or no MGT component found on this clip" });
70
+ }
71
+
72
+ var numProps = 0;
73
+ try { numProps = mgtComp.properties.numItems; } catch (e4) { numProps = 0; }
74
+
75
+ var properties = [];
76
+ for (var p = 0; p < numProps; p++) {
77
+ var prop = mgtComp.properties[p];
78
+ var info = { displayName: null, value: null, isTimeVarying: null, keyCount: null };
79
+ try { info.displayName = prop.displayName; } catch (e5) { info.displayName = null; }
80
+ try { info.value = prop.getValue(); } catch (e6) { info.value = null; }
81
+ try { info.isTimeVarying = prop.isTimeVarying(); } catch (e7) { info.isTimeVarying = null; }
82
+ try {
83
+ if (info.isTimeVarying) {
84
+ var keys = prop.getKeys();
85
+ info.keyCount = keys ? keys.length : 0;
86
+ } else {
87
+ info.keyCount = 0;
88
+ }
89
+ } catch (e8) {
90
+ info.keyCount = null;
91
+ }
92
+ properties.push(info);
93
+ }
94
+
95
+ return JSON.stringify({
96
+ ok: true,
97
+ result: {
98
+ sequenceName: seq.name,
99
+ trackType: args.trackType,
100
+ trackIndex: args.trackIndex,
101
+ clipIndex: args.clipIndex,
102
+ clipName: clipName,
103
+ properties: properties,
104
+ propertyCount: properties.length,
105
+ note: "values are raw getValue() output — a MOGRT's Source Text property is a 4-byte-header+JSON binary blob on this build per PREMIERE_API_NOTES.md, not decoded here (read-only command)."
106
+ }
107
+ });
108
+ } catch (e) {
109
+ return JSON.stringify({ ok: false, error: e.toString() });
110
+ }
111
+ }
@@ -0,0 +1,131 @@
1
+ // Command: get-next-edit-point → ppb_getNextEditPoint
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (findSequenceByName,
4
+ // timeValueToSeconds, ...) are already defined there.
5
+ //
6
+ // Standard-DOM read only — no QE DOM needed, no need to activate the
7
+ // sequence tab. Ported from leancoderkavy's premiere-pro-mcp
8
+ // `get_next_edit_point` tool (utility.ts): collects every clip start/end
9
+ // boundary across the given track type(s), then finds the nearest one
10
+ // strictly before/after the playhead.
11
+
12
+ var GET_NEXT_EDIT_POINT_EPSILON_SECONDS = 1e-6;
13
+
14
+ function ppb_getNextEditPoint(argsJson) {
15
+ try {
16
+ var args;
17
+ try {
18
+ args = JSON.parse(argsJson);
19
+ } catch (e) {
20
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
21
+ }
22
+
23
+ var direction = args.direction || "next";
24
+ if (direction !== "next" && direction !== "previous") {
25
+ return JSON.stringify({ ok: false, error: "direction must be \"next\" or \"previous\"" });
26
+ }
27
+ var trackType = args.trackType || "both";
28
+ if (trackType !== "video" && trackType !== "audio" && trackType !== "both") {
29
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\", \"audio\", or \"both\"" });
30
+ }
31
+
32
+ if (!app.project) {
33
+ return JSON.stringify({ ok: false, error: "no project open" });
34
+ }
35
+
36
+ var seq = null;
37
+ if (args.sequenceName && typeof args.sequenceName === "string") {
38
+ seq = findSequenceByName(args.sequenceName);
39
+ if (!seq) {
40
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
41
+ }
42
+ } else {
43
+ seq = app.project.activeSequence;
44
+ if (!seq) {
45
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
46
+ }
47
+ }
48
+
49
+ var playheadSeconds = null;
50
+ try {
51
+ playheadSeconds = timeValueToSeconds(seq.getPlayerPosition());
52
+ } catch (e) {
53
+ return JSON.stringify({ ok: false, error: "could not read playhead position: " + e.toString() });
54
+ }
55
+ if (playheadSeconds === null) {
56
+ return JSON.stringify({ ok: false, error: "could not read playhead position" });
57
+ }
58
+
59
+ var editPoints = [];
60
+
61
+ function collectPoints(trackCollection) {
62
+ var numTracks = 0;
63
+ try { numTracks = trackCollection.numTracks; } catch (e) { return; }
64
+ for (var t = 0; t < numTracks; t++) {
65
+ var track = trackCollection[t];
66
+ var numClips = 0;
67
+ try { numClips = track.clips.numItems; } catch (e) { continue; }
68
+ for (var c = 0; c < numClips; c++) {
69
+ var clip = track.clips[c];
70
+ try { editPoints.push(timeValueToSeconds(clip.start)); } catch (e) { /* skip */ }
71
+ try { editPoints.push(timeValueToSeconds(clip.end)); } catch (e) { /* skip */ }
72
+ }
73
+ }
74
+ }
75
+
76
+ if (trackType !== "audio") {
77
+ collectPoints(seq.videoTracks);
78
+ }
79
+ if (trackType !== "video") {
80
+ collectPoints(seq.audioTracks);
81
+ }
82
+
83
+ editPoints.sort(function (a, b) { return a - b; });
84
+ var unique = [];
85
+ for (var i = 0; i < editPoints.length; i++) {
86
+ if (editPoints[i] === null || typeof editPoints[i] === "undefined") {
87
+ continue;
88
+ }
89
+ if (unique.length === 0 || Math.abs(editPoints[i] - unique[unique.length - 1]) > GET_NEXT_EDIT_POINT_EPSILON_SECONDS) {
90
+ unique.push(editPoints[i]);
91
+ }
92
+ }
93
+
94
+ var found = null;
95
+ if (direction === "next") {
96
+ for (var n = 0; n < unique.length; n++) {
97
+ if (unique[n] > playheadSeconds + GET_NEXT_EDIT_POINT_EPSILON_SECONDS) {
98
+ found = unique[n];
99
+ break;
100
+ }
101
+ }
102
+ } else {
103
+ for (var p = unique.length - 1; p >= 0; p--) {
104
+ if (unique[p] < playheadSeconds - GET_NEXT_EDIT_POINT_EPSILON_SECONDS) {
105
+ found = unique[p];
106
+ break;
107
+ }
108
+ }
109
+ }
110
+
111
+ if (found === null) {
112
+ return JSON.stringify({
113
+ ok: true,
114
+ result: { sequenceName: seq.name, found: false, direction: direction, playheadSeconds: playheadSeconds }
115
+ });
116
+ }
117
+
118
+ return JSON.stringify({
119
+ ok: true,
120
+ result: {
121
+ sequenceName: seq.name,
122
+ found: true,
123
+ direction: direction,
124
+ editPointSeconds: found,
125
+ playheadSeconds: playheadSeconds
126
+ }
127
+ });
128
+ } catch (e) {
129
+ return JSON.stringify({ ok: false, error: e.toString() });
130
+ }
131
+ }
@@ -0,0 +1,67 @@
1
+ // Command: get-offline-media → ppb_getOfflineMedia
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (TICKS_PER_SECOND,
4
+ // ensureQEEnabled, findSequenceByName, ...) are already defined there.
5
+ //
6
+ // Recursive walk of app.project.rootItem.children (same shape as
7
+ // list-project-items.jsx), collecting every item where isOffline() is
8
+ // true. Helper names are prefixed ppbOfflineMedia_ to avoid colliding with
9
+ // same-purpose helpers in other lazily-loaded command files evaluated into
10
+ // this same global context.
11
+
12
+ function ppbOfflineMedia_isBin(item) {
13
+ try {
14
+ return typeof ProjectItemType !== "undefined" && item.type === ProjectItemType.BIN;
15
+ } catch (e) {
16
+ return false;
17
+ }
18
+ }
19
+
20
+ // Capped at depth 32 to defend against pathological/circular bin
21
+ // structures rather than looping forever.
22
+ function ppbOfflineMedia_scan(item, depth, results) {
23
+ if (depth > 32) {
24
+ return;
25
+ }
26
+
27
+ var isOffline = false;
28
+ try {
29
+ isOffline = item.isOffline();
30
+ } catch (e) {
31
+ isOffline = false;
32
+ }
33
+
34
+ if (isOffline) {
35
+ var entry = { nodeId: null, name: null, treePath: null, mediaPath: null, colorLabel: null };
36
+ try { entry.nodeId = item.nodeId; } catch (e) { entry.nodeId = null; }
37
+ try { entry.name = item.name; } catch (e) { entry.name = null; }
38
+ try { entry.treePath = item.treePath; } catch (e) { entry.treePath = null; }
39
+ try { entry.mediaPath = item.getMediaPath(); } catch (e) { entry.mediaPath = null; }
40
+ try { entry.colorLabel = item.getColorLabel(); } catch (e) { entry.colorLabel = null; }
41
+ results.push(entry);
42
+ }
43
+
44
+ if (ppbOfflineMedia_isBin(item) && item.children) {
45
+ for (var i = 0; i < item.children.numItems; i++) {
46
+ ppbOfflineMedia_scan(item.children[i], depth + 1, results);
47
+ }
48
+ }
49
+ }
50
+
51
+ function ppb_getOfflineMedia(argsJson) {
52
+ try {
53
+ if (!app.project) {
54
+ return JSON.stringify({ ok: false, error: "no project open" });
55
+ }
56
+
57
+ var results = [];
58
+ var root = app.project.rootItem;
59
+ for (var i = 0; i < root.children.numItems; i++) {
60
+ ppbOfflineMedia_scan(root.children[i], 1, results);
61
+ }
62
+
63
+ return JSON.stringify({ ok: true, result: { offlineCount: results.length, items: results } });
64
+ } catch (e) {
65
+ return JSON.stringify({ ok: false, error: e.toString() });
66
+ }
67
+ }
@@ -0,0 +1,50 @@
1
+ // Command: get-open-projects → ppb_getOpenProjects
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (TICKS_PER_SECOND,
4
+ // ensureQEEnabled, findSequenceByName, ...) are already defined there.
5
+ //
6
+ // Lightweight list of every currently OPEN project (app.projects), unlike
7
+ // get-project-info (single active project, full sequence detail) or
8
+ // get-full-project-overview (single active project, bin tree + media
9
+ // counts) — this command deliberately reports name/path/isActive only, no
10
+ // per-project sequence data. This replaces the multi-project-listing role
11
+ // previously covered by get-project-metadata (removed in a parallel task);
12
+ // use get-project-info / get-full-project-overview for sequence/bin detail
13
+ // on whichever project is currently active.
14
+
15
+ function ppb_getOpenProjects(argsJson) {
16
+ try {
17
+ if (!app.projects || app.projects.numProjects === 0) {
18
+ return JSON.stringify({ ok: true, result: { projects: [], count: 0 } });
19
+ }
20
+
21
+ var activePath = null;
22
+ try {
23
+ activePath = app.project ? app.project.path : null;
24
+ } catch (e) {
25
+ activePath = null;
26
+ }
27
+
28
+ var projects = [];
29
+ for (var i = 0; i < app.projects.numProjects; i++) {
30
+ var proj = app.projects[i];
31
+ var name = null;
32
+ var path = null;
33
+ var isActive = null;
34
+
35
+ try { name = proj.name; } catch (e) { name = null; }
36
+ try { path = proj.path; } catch (e) { path = null; }
37
+ try {
38
+ isActive = (path !== null && activePath !== null) ? (path === activePath) : null;
39
+ } catch (e) {
40
+ isActive = null;
41
+ }
42
+
43
+ projects.push({ name: name, path: path, isActive: isActive });
44
+ }
45
+
46
+ return JSON.stringify({ ok: true, result: { projects: projects, count: projects.length } });
47
+ } catch (e) {
48
+ return JSON.stringify({ ok: false, error: e.toString() });
49
+ }
50
+ }
@@ -0,0 +1,164 @@
1
+ // Command: get-premiere-state → ppb_getPremiereState
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (TICKS_PER_SECOND, ...)
4
+ // are already defined there.
5
+ //
6
+ // A full point-in-time snapshot of whatever Premiere Pro state currently
7
+ // exists: app version, open project, active sequence, playhead position,
8
+ // and current selection. Unlike most other commands, having no project (or
9
+ // no active sequence, or no selection) open is NOT an error here — the
10
+ // whole point of this command is to truthfully report whatever state
11
+ // exists, including "nothing is open right now".
12
+
13
+ function ppb_getPremiereState() {
14
+ try {
15
+ var result = {
16
+ appVersion: null,
17
+ project: null,
18
+ activeSequence: null,
19
+ playheadSeconds: null,
20
+ selection: null
21
+ };
22
+
23
+ try {
24
+ result.appVersion = app.version;
25
+ } catch (e) {
26
+ result.appVersion = null;
27
+ }
28
+
29
+ var proj = null;
30
+ try {
31
+ proj = app.project;
32
+ } catch (e) {
33
+ proj = null;
34
+ }
35
+
36
+ if (proj) {
37
+ var projectInfo = { name: null, path: null };
38
+ try {
39
+ projectInfo.name = proj.name;
40
+ } catch (e) {
41
+ projectInfo.name = null;
42
+ }
43
+ try {
44
+ projectInfo.path = proj.path;
45
+ } catch (e) {
46
+ projectInfo.path = null;
47
+ }
48
+ result.project = projectInfo;
49
+
50
+ var seq = null;
51
+ try {
52
+ seq = proj.activeSequence;
53
+ } catch (e) {
54
+ seq = null;
55
+ }
56
+
57
+ if (seq) {
58
+ var seqInfo = {
59
+ name: null,
60
+ sequenceID: null,
61
+ frameRate: null,
62
+ durationSeconds: null,
63
+ width: null,
64
+ height: null
65
+ };
66
+ try {
67
+ seqInfo.name = seq.name;
68
+ } catch (e) {
69
+ seqInfo.name = null;
70
+ }
71
+ try {
72
+ seqInfo.sequenceID = seq.sequenceID;
73
+ } catch (e) {
74
+ seqInfo.sequenceID = null;
75
+ }
76
+ try {
77
+ seqInfo.frameRate = TICKS_PER_SECOND / Number(seq.timebase);
78
+ } catch (e) {
79
+ seqInfo.frameRate = null;
80
+ }
81
+ try {
82
+ seqInfo.durationSeconds = (Number(seq.end) - Number(seq.zeroPoint)) / TICKS_PER_SECOND;
83
+ } catch (e) {
84
+ seqInfo.durationSeconds = null;
85
+ }
86
+ try {
87
+ var settings = seq.getSettings();
88
+ seqInfo.width = settings.videoFrameWidth;
89
+ seqInfo.height = settings.videoFrameHeight;
90
+ } catch (e) {
91
+ seqInfo.width = null;
92
+ seqInfo.height = null;
93
+ }
94
+ result.activeSequence = seqInfo;
95
+
96
+ try {
97
+ var pos = seq.getPlayerPosition();
98
+ try {
99
+ result.playheadSeconds = pos.seconds;
100
+ } catch (e2) {
101
+ result.playheadSeconds = Number(pos.ticks) / TICKS_PER_SECOND;
102
+ }
103
+ } catch (e) {
104
+ result.playheadSeconds = null;
105
+ }
106
+
107
+ // seq.getSelection() has been seen returning either a plain array
108
+ // (.length) or a TrackItem-collection-style object (.numItems) —
109
+ // probe both defensively rather than assuming one shape.
110
+ try {
111
+ var sel = seq.getSelection();
112
+ var selCount = 0;
113
+ if (sel) {
114
+ if (typeof sel.numItems === "number") {
115
+ selCount = sel.numItems;
116
+ } else if (typeof sel.length === "number") {
117
+ selCount = sel.length;
118
+ }
119
+ }
120
+
121
+ var selArray = [];
122
+ for (var i = 0; i < selCount; i++) {
123
+ var item = sel[i];
124
+ var entry = { name: null, mediaType: null, startSeconds: null, endSeconds: null, nodeId: null };
125
+ try {
126
+ entry.name = item.name;
127
+ } catch (e) {
128
+ entry.name = null;
129
+ }
130
+ try {
131
+ entry.mediaType = item.mediaType;
132
+ } catch (e) {
133
+ entry.mediaType = null;
134
+ }
135
+ try {
136
+ entry.startSeconds = item.start.seconds;
137
+ } catch (e) {
138
+ entry.startSeconds = null;
139
+ }
140
+ try {
141
+ entry.endSeconds = item.end.seconds;
142
+ } catch (e) {
143
+ entry.endSeconds = null;
144
+ }
145
+ try {
146
+ entry.nodeId = item.nodeId;
147
+ } catch (e) {
148
+ entry.nodeId = null;
149
+ }
150
+ selArray.push(entry);
151
+ }
152
+ result.selection = selArray;
153
+ } catch (e) {
154
+ // getSelection() itself unavailable/threw — distinct from "nothing selected"
155
+ result.selection = null;
156
+ }
157
+ }
158
+ }
159
+
160
+ return JSON.stringify({ ok: true, result: result });
161
+ } catch (e) {
162
+ return JSON.stringify({ ok: false, error: e.toString() });
163
+ }
164
+ }
@@ -0,0 +1,63 @@
1
+ // Command: get-project-info → ppb_getProjectInfo
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (TICKS_PER_SECOND,
4
+ // ensureQEEnabled, findSequenceByName, ...) are already defined there.
5
+ //
6
+ // Unlike the multi-project get-open-projects.jsx (which lists every
7
+ // currently OPEN project), this operates on app.project — the single
8
+ // active project — and additionally reports the root bin's item count.
9
+
10
+ function ppb_getProjectInfo(argsJson) {
11
+ try {
12
+ if (!app.project) {
13
+ return JSON.stringify({ ok: false, error: "no project open" });
14
+ }
15
+
16
+ var proj = app.project;
17
+ var sequences = [];
18
+
19
+ for (var j = 0; j < proj.sequences.numSequences; j++) {
20
+ var seq = proj.sequences[j];
21
+ var frameRate = null;
22
+ var durationSeconds = null;
23
+
24
+ try {
25
+ frameRate = TICKS_PER_SECOND / Number(seq.timebase);
26
+ } catch (e) {
27
+ frameRate = null;
28
+ }
29
+
30
+ try {
31
+ durationSeconds = (Number(seq.end) - Number(seq.zeroPoint)) / TICKS_PER_SECOND;
32
+ } catch (e) {
33
+ durationSeconds = null;
34
+ }
35
+
36
+ sequences.push({
37
+ name: seq.name,
38
+ sequenceID: seq.sequenceID,
39
+ frameRate: frameRate,
40
+ durationSeconds: durationSeconds
41
+ });
42
+ }
43
+
44
+ var numRootItems = null;
45
+ try {
46
+ numRootItems = proj.rootItem.children.numItems;
47
+ } catch (e) {
48
+ numRootItems = null;
49
+ }
50
+
51
+ var result = {
52
+ name: proj.name,
53
+ path: proj.path,
54
+ numSequences: proj.sequences.numSequences,
55
+ sequences: sequences,
56
+ numRootItems: numRootItems
57
+ };
58
+
59
+ return JSON.stringify({ ok: true, result: result });
60
+ } catch (e) {
61
+ return JSON.stringify({ ok: false, error: e.toString() });
62
+ }
63
+ }