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,221 @@
1
+ // Command: set-clip-properties → ppb_setClipProperties
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (findSequenceByName,
4
+ // ...) are already defined there.
5
+ //
6
+ // Standard-DOM mutation. Ported from leancoderkavy's premiere-pro-mcp
7
+ // `set_clip_properties` tool (timeline.ts) — a thin composition over the
8
+ // same Motion/Opacity-component property lookups used by the individual
9
+ // set-clip-* commands (set_clip_opacity/scale/position/rotation in
10
+ // advanced.ts), bundled into one bulk call as the reference tool does.
11
+ // Only properties the reference tool itself supports are included: opacity
12
+ // (0-100), speed (multiplier, e.g. 1.0 = normal — passed to
13
+ // clip.setSpeed(speed*100) matching the reference's percent conversion),
14
+ // scale, positionX/positionY (Motion "Position", set together as [x,y] —
15
+ // if only one is given, the OTHER axis's current value is read first and
16
+ // preserved), and rotation (degrees). Every requested property gets its
17
+ // own {previousValue, requestedValue, newValue, verified} entry; a
18
+ // property that isn't requested is left completely untouched.
19
+ function ppb_setClipPropertiesFindMotionProperty(clip, displayName) {
20
+ try {
21
+ for (var i = 0; i < clip.components.numItems; i++) {
22
+ var comp = clip.components[i];
23
+ var compName = null;
24
+ var compMatch = null;
25
+ try { compName = comp.displayName; } catch (e) { compName = null; }
26
+ try { compMatch = comp.matchName; } catch (e) { compMatch = null; }
27
+ if (compName === "Motion" || compMatch === "AE.ADBE Motion") {
28
+ for (var p = 0; p < comp.properties.numItems; p++) {
29
+ var propName = null;
30
+ try { propName = comp.properties[p].displayName; } catch (e) { propName = null; }
31
+ if (propName === displayName) {
32
+ return comp.properties[p];
33
+ }
34
+ }
35
+ }
36
+ }
37
+ } catch (e) {
38
+ return null;
39
+ }
40
+ return null;
41
+ }
42
+
43
+ function ppb_setClipPropertiesFindOpacityProperty(clip) {
44
+ try {
45
+ for (var i = 0; i < clip.components.numItems; i++) {
46
+ var comp = clip.components[i];
47
+ var compName = null;
48
+ var compMatch = null;
49
+ try { compName = comp.displayName; } catch (e) { compName = null; }
50
+ try { compMatch = comp.matchName; } catch (e) { compMatch = null; }
51
+ if (compName === "Opacity" || compMatch === "AE.ADBE Opacity") {
52
+ for (var p = 0; p < comp.properties.numItems; p++) {
53
+ var propName = null;
54
+ try { propName = comp.properties[p].displayName; } catch (e) { propName = null; }
55
+ if (propName === "Opacity") {
56
+ return comp.properties[p];
57
+ }
58
+ }
59
+ }
60
+ }
61
+ } catch (e) {
62
+ return null;
63
+ }
64
+ return null;
65
+ }
66
+
67
+ function ppb_setClipPropertiesApplyScalar(prop, requestedValue, results, fieldName) {
68
+ if (!prop) {
69
+ results[fieldName] = { requestedValue: requestedValue, error: "property not found on clip" };
70
+ return;
71
+ }
72
+ var previousValue = null;
73
+ try { previousValue = prop.getValue(); } catch (e) { previousValue = null; }
74
+ var entry = { previousValue: previousValue, requestedValue: requestedValue, newValue: null, verified: false };
75
+ try {
76
+ prop.setValue(requestedValue, true);
77
+ } catch (e) {
78
+ entry.error = e.toString();
79
+ results[fieldName] = entry;
80
+ return;
81
+ }
82
+ try { entry.newValue = prop.getValue(); } catch (e) { entry.newValue = null; }
83
+ entry.verified = entry.newValue !== null && Math.abs(entry.newValue - requestedValue) < 0.001;
84
+ results[fieldName] = entry;
85
+ }
86
+
87
+ function ppb_setClipProperties(argsJson) {
88
+ try {
89
+ var args;
90
+ try {
91
+ args = JSON.parse(argsJson);
92
+ } catch (e) {
93
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
94
+ }
95
+
96
+ if (args.trackType !== "video" && args.trackType !== "audio") {
97
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
98
+ }
99
+ if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
100
+ return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
101
+ }
102
+ if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
103
+ return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
104
+ }
105
+
106
+ var hasOpacity = typeof args.opacity === "number";
107
+ var hasSpeed = typeof args.speed === "number";
108
+ var hasScale = typeof args.scale === "number";
109
+ var hasPositionX = typeof args.positionX === "number";
110
+ var hasPositionY = typeof args.positionY === "number";
111
+ var hasRotation = typeof args.rotation === "number";
112
+
113
+ if (!hasOpacity && !hasSpeed && !hasScale && !hasPositionX && !hasPositionY && !hasRotation) {
114
+ return JSON.stringify({ ok: false, error: "at least one of opacity, speed, scale, positionX, positionY, rotation is required" });
115
+ }
116
+
117
+ if (!app.project) {
118
+ return JSON.stringify({ ok: false, error: "no project open" });
119
+ }
120
+
121
+ var seq = null;
122
+ if (args.sequenceName && typeof args.sequenceName === "string") {
123
+ seq = findSequenceByName(args.sequenceName);
124
+ if (!seq) {
125
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
126
+ }
127
+ } else {
128
+ seq = app.project.activeSequence;
129
+ if (!seq) {
130
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
131
+ }
132
+ }
133
+
134
+ var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
135
+ var numTracks = trackCollection.numTracks;
136
+ if (args.trackIndex >= numTracks) {
137
+ return JSON.stringify({
138
+ ok: false,
139
+ error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
140
+ });
141
+ }
142
+
143
+ var track = trackCollection[args.trackIndex];
144
+ var numClips = track.clips.numItems;
145
+ if (args.clipIndex >= numClips) {
146
+ return JSON.stringify({
147
+ ok: false,
148
+ error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
149
+ });
150
+ }
151
+
152
+ var clip = track.clips[args.clipIndex];
153
+ var clipName = null;
154
+ try { clipName = clip.name; } catch (e) { clipName = null; }
155
+
156
+ var changes = {};
157
+
158
+ if (hasOpacity) {
159
+ ppb_setClipPropertiesApplyScalar(ppb_setClipPropertiesFindOpacityProperty(clip), args.opacity, changes, "opacity");
160
+ }
161
+
162
+ if (hasSpeed) {
163
+ var speedEntry = { requestedValue: args.speed, newValue: null, verified: false };
164
+ try { speedEntry.previousValue = clip.getSpeed(); } catch (e) { speedEntry.previousValue = null; }
165
+ try {
166
+ clip.setSpeed(args.speed * 100);
167
+ } catch (e) {
168
+ speedEntry.error = e.toString();
169
+ }
170
+ try { speedEntry.newValue = clip.getSpeed(); } catch (e) { speedEntry.newValue = null; }
171
+ speedEntry.verified = speedEntry.newValue !== null && Math.abs(speedEntry.newValue - args.speed) < 0.001;
172
+ changes.speed = speedEntry;
173
+ }
174
+
175
+ if (hasScale) {
176
+ ppb_setClipPropertiesApplyScalar(ppb_setClipPropertiesFindMotionProperty(clip, "Scale"), args.scale, changes, "scale");
177
+ }
178
+
179
+ if (hasRotation) {
180
+ ppb_setClipPropertiesApplyScalar(ppb_setClipPropertiesFindMotionProperty(clip, "Rotation"), args.rotation, changes, "rotation");
181
+ }
182
+
183
+ if (hasPositionX || hasPositionY) {
184
+ var posProp = ppb_setClipPropertiesFindMotionProperty(clip, "Position");
185
+ if (!posProp) {
186
+ changes.position = { error: "Position property not found on clip's Motion component" };
187
+ } else {
188
+ var previousPos = null;
189
+ try { previousPos = posProp.getValue(); } catch (e) { previousPos = null; }
190
+ var px = previousPos && previousPos.length >= 2 ? previousPos[0] : 0;
191
+ var py = previousPos && previousPos.length >= 2 ? previousPos[1] : 0;
192
+ if (hasPositionX) { px = args.positionX; }
193
+ if (hasPositionY) { py = args.positionY; }
194
+
195
+ var posEntry = { previousValue: previousPos, requestedValue: [px, py], newValue: null, verified: false };
196
+ try {
197
+ posProp.setValue([px, py], true);
198
+ } catch (e) {
199
+ posEntry.error = e.toString();
200
+ }
201
+ try { posEntry.newValue = posProp.getValue(); } catch (e) { posEntry.newValue = null; }
202
+ posEntry.verified = posEntry.newValue !== null && posEntry.newValue.length >= 2 &&
203
+ Math.abs(posEntry.newValue[0] - px) < 0.001 && Math.abs(posEntry.newValue[1] - py) < 0.001;
204
+ changes.position = posEntry;
205
+ }
206
+ }
207
+
208
+ var result = {
209
+ sequenceName: seq.name,
210
+ trackType: args.trackType,
211
+ trackIndex: args.trackIndex,
212
+ clipIndex: args.clipIndex,
213
+ clipName: clipName,
214
+ changes: changes
215
+ };
216
+
217
+ return JSON.stringify({ ok: true, result: result });
218
+ } catch (e) {
219
+ return JSON.stringify({ ok: false, error: e.toString() });
220
+ }
221
+ }
@@ -0,0 +1,102 @@
1
+ // Command: set-clip-rotation → ppb_setClipRotation
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (findSequenceByName,
4
+ // findClipComponent, setComponentProperty, ...) are already defined there.
5
+ //
6
+ // Standard-DOM only — no QE needed. Ported from leancoderkavy's
7
+ // premiere-pro-mcp `set_clip_rotation` tool (track-targeting.ts), addressed
8
+ // here by trackType/trackIndex/clipIndex (same convention as
9
+ // get-full-clip-info) instead of node_id. Sets the Motion component's
10
+ // Rotation property (degrees; values beyond 0-360 are allowed for multiple
11
+ // rotations). Mutating — undo is non-functional on this build, so
12
+ // previousValue in the result is the caller's only restoration path.
13
+
14
+ function ppb_setClipRotation(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
+ if (args.trackType !== "video" && args.trackType !== "audio") {
24
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
25
+ }
26
+ if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
27
+ return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
28
+ }
29
+ if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
30
+ return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
31
+ }
32
+ if (typeof args.degrees !== "number") {
33
+ return JSON.stringify({ ok: false, error: "degrees must be a number" });
34
+ }
35
+
36
+ if (!app.project) {
37
+ return JSON.stringify({ ok: false, error: "no project open" });
38
+ }
39
+
40
+ var seq = null;
41
+ if (args.sequenceName && typeof args.sequenceName === "string") {
42
+ seq = findSequenceByName(args.sequenceName);
43
+ if (!seq) {
44
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
45
+ }
46
+ } else {
47
+ seq = app.project.activeSequence;
48
+ if (!seq) {
49
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
50
+ }
51
+ }
52
+
53
+ var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
54
+ var numTracks = trackCollection.numTracks;
55
+ if (args.trackIndex >= numTracks) {
56
+ return JSON.stringify({
57
+ ok: false,
58
+ error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
59
+ });
60
+ }
61
+
62
+ var track = trackCollection[args.trackIndex];
63
+ var numClips = track.clips.numItems;
64
+ if (args.clipIndex >= numClips) {
65
+ return JSON.stringify({
66
+ ok: false,
67
+ error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
68
+ });
69
+ }
70
+
71
+ var clip = track.clips[args.clipIndex];
72
+ var clipName = null;
73
+ try { clipName = clip.name; } catch (e) { clipName = null; }
74
+
75
+ var motion = findClipComponent(clip, ["AE.ADBE Motion"], ["Motion"]);
76
+ if (!motion) {
77
+ return JSON.stringify({ ok: false, error: "Motion component not found on clip" });
78
+ }
79
+
80
+ var setResult = setComponentProperty(motion, ["Rotation"], args.degrees);
81
+ if (!setResult.found) {
82
+ return JSON.stringify({ ok: false, error: "Rotation property not found on the Motion component" });
83
+ }
84
+
85
+ return JSON.stringify({
86
+ ok: true,
87
+ result: {
88
+ sequenceName: seq.name,
89
+ trackType: args.trackType,
90
+ trackIndex: args.trackIndex,
91
+ clipIndex: args.clipIndex,
92
+ clipName: clipName,
93
+ previousValue: setResult.previousValue,
94
+ requestedValue: setResult.requestedValue,
95
+ newValue: setResult.newValue,
96
+ verified: setResult.verified
97
+ }
98
+ });
99
+ } catch (e) {
100
+ return JSON.stringify({ ok: false, error: e.toString() });
101
+ }
102
+ }
@@ -0,0 +1,102 @@
1
+ // Command: set-clip-scale → ppb_setClipScale
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (findSequenceByName,
4
+ // findClipComponent, setComponentProperty, ...) are already defined there.
5
+ //
6
+ // Standard-DOM only — no QE needed. Ported from leancoderkavy's
7
+ // premiere-pro-mcp `set_clip_scale` tool (track-targeting.ts), addressed
8
+ // here by trackType/trackIndex/clipIndex (same convention as
9
+ // get-full-clip-info) instead of node_id. Sets the Motion component's
10
+ // Scale property (100 = original size). Mutating — undo is non-functional
11
+ // on this build, so previousValue in the result is the caller's only
12
+ // restoration path.
13
+
14
+ function ppb_setClipScale(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
+ if (args.trackType !== "video" && args.trackType !== "audio") {
24
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
25
+ }
26
+ if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
27
+ return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
28
+ }
29
+ if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
30
+ return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
31
+ }
32
+ if (typeof args.scale !== "number") {
33
+ return JSON.stringify({ ok: false, error: "scale must be a number (100 = original size)" });
34
+ }
35
+
36
+ if (!app.project) {
37
+ return JSON.stringify({ ok: false, error: "no project open" });
38
+ }
39
+
40
+ var seq = null;
41
+ if (args.sequenceName && typeof args.sequenceName === "string") {
42
+ seq = findSequenceByName(args.sequenceName);
43
+ if (!seq) {
44
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
45
+ }
46
+ } else {
47
+ seq = app.project.activeSequence;
48
+ if (!seq) {
49
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
50
+ }
51
+ }
52
+
53
+ var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
54
+ var numTracks = trackCollection.numTracks;
55
+ if (args.trackIndex >= numTracks) {
56
+ return JSON.stringify({
57
+ ok: false,
58
+ error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
59
+ });
60
+ }
61
+
62
+ var track = trackCollection[args.trackIndex];
63
+ var numClips = track.clips.numItems;
64
+ if (args.clipIndex >= numClips) {
65
+ return JSON.stringify({
66
+ ok: false,
67
+ error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
68
+ });
69
+ }
70
+
71
+ var clip = track.clips[args.clipIndex];
72
+ var clipName = null;
73
+ try { clipName = clip.name; } catch (e) { clipName = null; }
74
+
75
+ var motion = findClipComponent(clip, ["AE.ADBE Motion"], ["Motion"]);
76
+ if (!motion) {
77
+ return JSON.stringify({ ok: false, error: "Motion component not found on clip" });
78
+ }
79
+
80
+ var setResult = setComponentProperty(motion, ["Scale"], args.scale);
81
+ if (!setResult.found) {
82
+ return JSON.stringify({ ok: false, error: "Scale property not found on the Motion component" });
83
+ }
84
+
85
+ return JSON.stringify({
86
+ ok: true,
87
+ result: {
88
+ sequenceName: seq.name,
89
+ trackType: args.trackType,
90
+ trackIndex: args.trackIndex,
91
+ clipIndex: args.clipIndex,
92
+ clipName: clipName,
93
+ previousValue: setResult.previousValue,
94
+ requestedValue: setResult.requestedValue,
95
+ newValue: setResult.newValue,
96
+ verified: setResult.verified
97
+ }
98
+ });
99
+ } catch (e) {
100
+ return JSON.stringify({ ok: false, error: e.toString() });
101
+ }
102
+ }
@@ -0,0 +1,144 @@
1
+ // Command: set-clip-selection → ppb_setClipSelection
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 only (clip.setSelected(bool, true)) — no QE needed. Ported
7
+ // from leancoderkavy's premiere-pro-mcp `set_clip_selection` tool
8
+ // (advanced.ts), which addresses the clip by node_id via that repo's
9
+ // __findClip() helper; this bridge instead uses the same
10
+ // trackType/trackIndex/clipIndex addressing as get-full-clip-info (no
11
+ // node-id lookup helper exists here). Mutation — verified both via the
12
+ // addressed clip's own isSelected() readback AND the sequence-wide
13
+ // seq.getSelection() readback, never via setSelected()'s own return value.
14
+
15
+ function ppb_setClipSelectionCollectSelection(seq) {
16
+ var sel = null;
17
+ try {
18
+ sel = seq.getSelection();
19
+ } catch (e) {
20
+ sel = null;
21
+ }
22
+ var selCount = 0;
23
+ if (sel) {
24
+ if (typeof sel.numItems === "number") {
25
+ selCount = sel.numItems;
26
+ } else if (typeof sel.length === "number") {
27
+ selCount = sel.length;
28
+ }
29
+ }
30
+ var selectedClips = [];
31
+ var cap = selCount > 20 ? 20 : selCount;
32
+ for (var i = 0; i < cap; i++) {
33
+ var item = sel[i];
34
+ var entry = { name: null, mediaType: null, startSeconds: null, endSeconds: null, nodeId: null };
35
+ try { entry.name = item.name; } catch (e) { entry.name = null; }
36
+ try { entry.mediaType = item.mediaType; } catch (e) { entry.mediaType = null; }
37
+ try { entry.startSeconds = timeValueToSeconds(item.start); } catch (e) { entry.startSeconds = null; }
38
+ try { entry.endSeconds = timeValueToSeconds(item.end); } catch (e) { entry.endSeconds = null; }
39
+ try { entry.nodeId = item.nodeId; } catch (e) { entry.nodeId = null; }
40
+ selectedClips.push(entry);
41
+ }
42
+ var result = { selectedCount: selCount, selectedClips: selectedClips };
43
+ if (selCount > 20) {
44
+ result.truncated = true;
45
+ }
46
+ return result;
47
+ }
48
+
49
+ function ppb_setClipSelection(argsJson) {
50
+ try {
51
+ var args;
52
+ try {
53
+ args = JSON.parse(argsJson);
54
+ } catch (e) {
55
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
56
+ }
57
+
58
+ if (args.trackType !== "video" && args.trackType !== "audio") {
59
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
60
+ }
61
+ if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
62
+ return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
63
+ }
64
+ if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
65
+ return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
66
+ }
67
+ if (typeof args.selected !== "boolean") {
68
+ return JSON.stringify({ ok: false, error: "selected must be a boolean" });
69
+ }
70
+
71
+ if (!app.project) {
72
+ return JSON.stringify({ ok: false, error: "no project open" });
73
+ }
74
+
75
+ var seq = null;
76
+ if (args.sequenceName && typeof args.sequenceName === "string") {
77
+ seq = findSequenceByName(args.sequenceName);
78
+ if (!seq) {
79
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
80
+ }
81
+ } else {
82
+ seq = app.project.activeSequence;
83
+ if (!seq) {
84
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
85
+ }
86
+ }
87
+
88
+ var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
89
+ var numTracks = trackCollection.numTracks;
90
+ if (args.trackIndex >= numTracks) {
91
+ return JSON.stringify({
92
+ ok: false,
93
+ error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
94
+ });
95
+ }
96
+
97
+ var track = trackCollection[args.trackIndex];
98
+ var numClips = track.clips.numItems;
99
+ if (args.clipIndex >= numClips) {
100
+ return JSON.stringify({
101
+ ok: false,
102
+ error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
103
+ });
104
+ }
105
+
106
+ var clip = track.clips[args.clipIndex];
107
+ var clipName = null;
108
+ try { clipName = clip.name; } catch (e) { clipName = null; }
109
+
110
+ try {
111
+ clip.setSelected(args.selected ? 1 : 0, true);
112
+ } catch (e) {
113
+ return JSON.stringify({ ok: false, error: "setSelected() failed: " + e.toString() });
114
+ }
115
+
116
+ var actualSelected = null;
117
+ try {
118
+ actualSelected = clip.isSelected();
119
+ } catch (e) {
120
+ actualSelected = null;
121
+ }
122
+
123
+ var selectionResult = ppb_setClipSelectionCollectSelection(seq);
124
+
125
+ var result = {
126
+ sequenceName: seq.name,
127
+ trackType: args.trackType,
128
+ trackIndex: args.trackIndex,
129
+ clipIndex: args.clipIndex,
130
+ clipName: clipName,
131
+ requestedSelected: args.selected,
132
+ actualSelected: actualSelected
133
+ };
134
+ result.selectedCount = selectionResult.selectedCount;
135
+ result.selectedClips = selectionResult.selectedClips;
136
+ if (selectionResult.truncated) {
137
+ result.truncated = true;
138
+ }
139
+
140
+ return JSON.stringify({ ok: true, result: result });
141
+ } catch (e) {
142
+ return JSON.stringify({ ok: false, error: e.toString() });
143
+ }
144
+ }