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,129 @@
1
+ // Command: set-override-pixel-aspect-ratio → ppb_setOverridePixelAspectRatio
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
+ // Ports the reference project's media.ts set_override_pixel_aspect_ratio
7
+ // tool. Item resolution by nodeId/name uses children-presence recursion
8
+ // (NOT an isBin() gate), per get-project-item-info.jsx's live-debugged
9
+ // finding. previousValue/newValue are read via item.getFootageInterpretation().
10
+ // pixelAspectRatio before/after calling
11
+ // item.setOverridePixelAspectRatio(numerator, denominator). Undo is
12
+ // non-functional on this build — previousValue is the only restoration
13
+ // path.
14
+
15
+ function ppbSetOverridePAR_findByNodeId(item, nodeId, depth) {
16
+ if (depth > 32) {
17
+ return null;
18
+ }
19
+ try {
20
+ if (item.nodeId === nodeId) {
21
+ return item;
22
+ }
23
+ } catch (e) {
24
+ // fall through
25
+ }
26
+ if (item.children && item.children.numItems > 0) {
27
+ for (var i = 0; i < item.children.numItems; i++) {
28
+ var found = ppbSetOverridePAR_findByNodeId(item.children[i], nodeId, depth + 1);
29
+ if (found) {
30
+ return found;
31
+ }
32
+ }
33
+ }
34
+ return null;
35
+ }
36
+
37
+ function ppbSetOverridePAR_findByName(item, name, depth) {
38
+ if (depth > 32) {
39
+ return null;
40
+ }
41
+ try {
42
+ if (item.name === name) {
43
+ return item;
44
+ }
45
+ } catch (e) {
46
+ // fall through
47
+ }
48
+ if (item.children && item.children.numItems > 0) {
49
+ for (var i = 0; i < item.children.numItems; i++) {
50
+ var found = ppbSetOverridePAR_findByName(item.children[i], name, depth + 1);
51
+ if (found) {
52
+ return found;
53
+ }
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+
59
+ function ppbSetOverridePAR_readPAR(item) {
60
+ try {
61
+ var interp = item.getFootageInterpretation();
62
+ if (interp) {
63
+ return interp.pixelAspectRatio;
64
+ }
65
+ } catch (e) {
66
+ // fall through
67
+ }
68
+ return null;
69
+ }
70
+
71
+ function ppb_setOverridePixelAspectRatio(argsJson) {
72
+ try {
73
+ var args;
74
+ try {
75
+ args = JSON.parse(argsJson);
76
+ } catch (e) {
77
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
78
+ }
79
+
80
+ var hasNodeId = typeof args.nodeId === "string" && args.nodeId.length > 0;
81
+ var hasName = typeof args.name === "string" && args.name.length > 0;
82
+ if (!hasNodeId && !hasName) {
83
+ return JSON.stringify({ ok: false, error: "either nodeId or name is required" });
84
+ }
85
+ if (typeof args.numerator !== "number" || args.numerator <= 0) {
86
+ return JSON.stringify({ ok: false, error: "numerator must be a positive number" });
87
+ }
88
+ if (typeof args.denominator !== "number" || args.denominator <= 0) {
89
+ return JSON.stringify({ ok: false, error: "denominator must be a positive number" });
90
+ }
91
+
92
+ if (!app.project) {
93
+ return JSON.stringify({ ok: false, error: "no project open" });
94
+ }
95
+
96
+ var item = hasNodeId
97
+ ? ppbSetOverridePAR_findByNodeId(app.project.rootItem, args.nodeId, 0)
98
+ : ppbSetOverridePAR_findByName(app.project.rootItem, args.name, 0);
99
+ if (!item) {
100
+ return JSON.stringify({ ok: false, error: "no project item found matching the given nodeId/name" });
101
+ }
102
+
103
+ var previousValue = ppbSetOverridePAR_readPAR(item);
104
+
105
+ try {
106
+ item.setOverridePixelAspectRatio(args.numerator, args.denominator);
107
+ } catch (e) {
108
+ return JSON.stringify({ ok: false, error: "setOverridePixelAspectRatio() failed: " + e.toString() });
109
+ }
110
+
111
+ var newValue = ppbSetOverridePAR_readPAR(item);
112
+ var requestedRatio = args.numerator / args.denominator;
113
+
114
+ return JSON.stringify({
115
+ ok: true,
116
+ result: {
117
+ nodeId: item.nodeId,
118
+ name: item.name,
119
+ previousValue: previousValue,
120
+ requestedNumerator: args.numerator,
121
+ requestedDenominator: args.denominator,
122
+ newValue: newValue,
123
+ verified: newValue !== null && Math.abs(newValue - requestedRatio) < 0.001
124
+ }
125
+ });
126
+ } catch (e) {
127
+ return JSON.stringify({ ok: false, error: e.toString() });
128
+ }
129
+ }
@@ -0,0 +1,192 @@
1
+ // Command: set-poster-frame → ppb_setPosterFrame
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context.
4
+ //
5
+ // Ported from leancoderkavy's premiere-pro-mcp set_poster_frame tool —
6
+ // but that reference implementation is itself an admitted non-starter:
7
+ // it calls item.setOverrideFrameRate(0) "to trigger an internal update"
8
+ // and returns a note saying the real effect "may require UI interaction".
9
+ // No poster-frame API is documented anywhere in PREMIERE_API_NOTES.md
10
+ // (built from three separate MCP repos) — this is genuinely uncertain
11
+ // API territory. This command instead PROBES a short list of plausible
12
+ // method names in turn (none confirmed to exist on any Premiere build we
13
+ // have notes on) rather than repeating the reference's known-fake call.
14
+ //
15
+ // Project-item addressing matches get-item-metadata.jsx (nodeId/name,
16
+ // depth-first bin walk, duplicated locally per this panel's convention).
17
+ //
18
+ // MUTATION RULE / HONESTY NOTE: if a setter call succeeds (doesn't throw),
19
+ // this command tries a short list of plausible GETTER names to read the
20
+ // poster frame back for verification. If none of those exist either
21
+ // (likely, since none of this is confirmed API), the result reports
22
+ // verified: false and says so explicitly — it does NOT claim success
23
+ // just because a call didn't throw, per this wave's mutation rules.
24
+
25
+ function ppbSetPosterFrame_walk(item, args, depth) {
26
+ if (depth > 32) {
27
+ return null;
28
+ }
29
+
30
+ var isBin = false;
31
+ try {
32
+ isBin = typeof ProjectItemType !== "undefined" && item.type === ProjectItemType.BIN;
33
+ } catch (e) {
34
+ isBin = false;
35
+ }
36
+
37
+ var matched = false;
38
+ if (args.nodeId !== null) {
39
+ try { matched = item.nodeId === args.nodeId; } catch (e) { matched = false; }
40
+ } else if (args.name !== null) {
41
+ try { matched = item.name === args.name; } catch (e) { matched = false; }
42
+ }
43
+ if (matched) {
44
+ return item;
45
+ }
46
+
47
+ if (isBin && item.children) {
48
+ for (var i = 0; i < item.children.numItems; i++) {
49
+ var found = ppbSetPosterFrame_walk(item.children[i], args, depth + 1);
50
+ if (found) {
51
+ return found;
52
+ }
53
+ }
54
+ }
55
+ return null;
56
+ }
57
+
58
+ function ppbSetPosterFrame_resolve(args) {
59
+ var root = app.project.rootItem;
60
+ for (var i = 0; i < root.children.numItems; i++) {
61
+ var found = ppbSetPosterFrame_walk(root.children[i], args, 1);
62
+ if (found) {
63
+ return found;
64
+ }
65
+ }
66
+ return null;
67
+ }
68
+
69
+ function ppb_setPosterFrame(argsJson) {
70
+ try {
71
+ var args;
72
+ try {
73
+ args = JSON.parse(argsJson);
74
+ } catch (e) {
75
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
76
+ }
77
+
78
+ var hasNodeId = typeof args.nodeId === "string" && args.nodeId.length > 0;
79
+ var hasName = typeof args.name === "string" && args.name.length > 0;
80
+ if (!hasNodeId && !hasName) {
81
+ return JSON.stringify({ ok: false, error: "either nodeId or name is required" });
82
+ }
83
+
84
+ if (typeof args.seconds !== "number" || isNaN(args.seconds) || args.seconds < 0) {
85
+ return JSON.stringify({ ok: false, error: "seconds must be a non-negative number" });
86
+ }
87
+
88
+ if (!app.project) {
89
+ return JSON.stringify({ ok: false, error: "no project open" });
90
+ }
91
+
92
+ var item = ppbSetPosterFrame_resolve({
93
+ nodeId: hasNodeId ? args.nodeId : null,
94
+ name: hasNodeId ? null : args.name
95
+ });
96
+ if (!item) {
97
+ return JSON.stringify({ ok: false, error: "no project item found matching the given nodeId/name" });
98
+ }
99
+
100
+ var ticksString = String(Math.round(args.seconds * TICKS_PER_SECOND));
101
+ var timeObj = null;
102
+ try {
103
+ timeObj = new Time();
104
+ timeObj.seconds = args.seconds;
105
+ } catch (e) {
106
+ timeObj = null;
107
+ }
108
+
109
+ // Candidate setter forms — none of these are confirmed to exist on
110
+ // any Premiere build documented in PREMIERE_API_NOTES.md; probed
111
+ // defensively in a plausible-to-least-plausible order.
112
+ var setAttempts = [];
113
+ var setSucceeded = false;
114
+ var setMethod = null;
115
+
116
+ function trySet(label, fn) {
117
+ if (setSucceeded) {
118
+ return;
119
+ }
120
+ try {
121
+ fn();
122
+ setAttempts.push({ method: label, success: true });
123
+ setSucceeded = true;
124
+ setMethod = label;
125
+ } catch (e) {
126
+ setAttempts.push({ method: label, success: false, error: e.toString() });
127
+ }
128
+ }
129
+
130
+ trySet("setPosterFrame(secondsNumber)", function () { item.setPosterFrame(args.seconds); });
131
+ trySet("setPosterFrame(ticksString)", function () { item.setPosterFrame(ticksString); });
132
+ trySet("setPosterFrame(TimeObject)", function () { item.setPosterFrame(timeObj); });
133
+ trySet("setPosterFrameTime(TimeObject)", function () { item.setPosterFrameTime(timeObj); });
134
+ trySet("setThumbnailFrame(ticksString)", function () { item.setThumbnailFrame(ticksString); });
135
+
136
+ if (!setSucceeded) {
137
+ return JSON.stringify({
138
+ ok: false,
139
+ error: "no known poster-frame setter API exists on this Premiere build — every candidate method threw or is undefined",
140
+ attempts: setAttempts
141
+ });
142
+ }
143
+
144
+ // Read-back attempt — also unconfirmed API, tried purely so an actual
145
+ // verification can be reported rather than trusting the setter alone.
146
+ var readAttempts = [];
147
+ var verifiedSeconds = null;
148
+ var verified = false;
149
+
150
+ function tryRead(label, fn) {
151
+ if (verified) {
152
+ return;
153
+ }
154
+ try {
155
+ var value = fn();
156
+ readAttempts.push({ method: label, success: true });
157
+ if (typeof value === "number") {
158
+ verifiedSeconds = value;
159
+ } else if (value && typeof value.seconds === "number") {
160
+ verifiedSeconds = value.seconds;
161
+ } else if (value && typeof value.ticks !== "undefined") {
162
+ verifiedSeconds = Number(value.ticks) / TICKS_PER_SECOND;
163
+ }
164
+ verified = verifiedSeconds !== null;
165
+ } catch (e) {
166
+ readAttempts.push({ method: label, success: false, error: e.toString() });
167
+ }
168
+ }
169
+
170
+ tryRead("getPosterFrame", function () { return item.getPosterFrame(); });
171
+ tryRead("getPosterFrameTime", function () { return item.getPosterFrameTime(); });
172
+ tryRead("posterFrame", function () { return item.posterFrame; });
173
+
174
+ return JSON.stringify({
175
+ ok: true,
176
+ result: {
177
+ item: (function () { try { return item.name; } catch (e) { return null; } })(),
178
+ requestedSeconds: args.seconds,
179
+ setMethod: setMethod,
180
+ setAttempts: setAttempts,
181
+ verified: verified,
182
+ verifiedSeconds: verifiedSeconds,
183
+ readAttempts: readAttempts,
184
+ note: verified
185
+ ? "poster frame set and confirmed via a read-back getter"
186
+ : "the setter call did not throw, but no known getter API could confirm the change actually took effect — treat this as UNCONFIRMED, not a verified success"
187
+ }
188
+ });
189
+ } catch (e) {
190
+ return JSON.stringify({ ok: false, error: e.toString() });
191
+ }
192
+ }
@@ -0,0 +1,69 @@
1
+ // Command: set-project-panel-metadata → ppb_setProjectPanelMetadata
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context.
4
+ //
5
+ // Write-side counterpart of the existing get-project-panel-metadata.jsx
6
+ // (which reads app.project.getProjectPanelMetadata() as an XML string).
7
+ // Ported from leancoderkavy/premiere-pro-mcp's project.ts
8
+ // set_project_panel_metadata: app.project.setProjectPanelMetadata(xml)
9
+ // REPLACES the Project panel's entire column/metadata configuration —
10
+ // not a merge/patch, same caveat as this repo's existing
11
+ // set-xmp-metadata.jsx for item-level XMP. previousValue/newValue are
12
+ // read via getProjectPanelMetadata() before/after; `verified` is a
13
+ // straightforward string comparison of newValue against the requested
14
+ // XML. Undo is NON-FUNCTIONAL on this build — previousValue is the only
15
+ // restoration path.
16
+
17
+ function ppb_setProjectPanelMetadata(argsJson) {
18
+ try {
19
+ var args;
20
+ try {
21
+ args = JSON.parse(argsJson);
22
+ } catch (e) {
23
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
24
+ }
25
+
26
+ if (typeof args.metadata !== "string" || args.metadata.length === 0) {
27
+ return JSON.stringify({ ok: false, error: "metadata (XML string) is required" });
28
+ }
29
+
30
+ if (!app.project) {
31
+ return JSON.stringify({ ok: false, error: "no project open" });
32
+ }
33
+ if (typeof app.project.setProjectPanelMetadata !== "function") {
34
+ return JSON.stringify({ ok: false, error: "setProjectPanelMetadata is not available on this Premiere build" });
35
+ }
36
+
37
+ var previousValue = null;
38
+ if (typeof app.project.getProjectPanelMetadata === "function") {
39
+ try { previousValue = app.project.getProjectPanelMetadata(); } catch (e) { previousValue = null; }
40
+ }
41
+
42
+ try {
43
+ app.project.setProjectPanelMetadata(args.metadata);
44
+ } catch (e) {
45
+ return JSON.stringify({ ok: false, error: "setProjectPanelMetadata() failed: " + e.toString() });
46
+ }
47
+
48
+ var newValue = null;
49
+ if (typeof app.project.getProjectPanelMetadata === "function") {
50
+ try { newValue = app.project.getProjectPanelMetadata(); } catch (e) { newValue = null; }
51
+ }
52
+
53
+ var verified = typeof newValue === "string" && newValue === args.metadata;
54
+
55
+ return JSON.stringify({
56
+ ok: true,
57
+ result: {
58
+ set: true,
59
+ requestedValue: args.metadata,
60
+ previousValue: previousValue,
61
+ newValue: newValue,
62
+ verified: verified,
63
+ note: "REPLACES the entire Project panel column/metadata configuration — not a merge; get-project-panel-metadata first and modify. Undo is NON-FUNCTIONAL on this build — previousValue is the only restoration path."
64
+ }
65
+ });
66
+ } catch (e) {
67
+ return JSON.stringify({ ok: false, error: e.toString() });
68
+ }
69
+ }
@@ -0,0 +1,101 @@
1
+ // Command: set-scale-to-frame-size → ppb_setScaleToFrameSize
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
+ // Ports the reference project's media.ts set_scale_to_frame_size tool.
7
+ // Item resolution by nodeId/name uses children-presence recursion (NOT an
8
+ // isBin() gate), per get-project-item-info.jsx's live-debugged finding.
9
+ // item.setScaleToFrameSize() has no confirmed getter to read the flag
10
+ // back, so success here only confirms the call didn't throw — same
11
+ // honesty pattern as refresh-media.
12
+
13
+ function ppbSetScaleToFrameSize_findByNodeId(item, nodeId, depth) {
14
+ if (depth > 32) {
15
+ return null;
16
+ }
17
+ try {
18
+ if (item.nodeId === nodeId) {
19
+ return item;
20
+ }
21
+ } catch (e) {
22
+ // fall through
23
+ }
24
+ if (item.children && item.children.numItems > 0) {
25
+ for (var i = 0; i < item.children.numItems; i++) {
26
+ var found = ppbSetScaleToFrameSize_findByNodeId(item.children[i], nodeId, depth + 1);
27
+ if (found) {
28
+ return found;
29
+ }
30
+ }
31
+ }
32
+ return null;
33
+ }
34
+
35
+ function ppbSetScaleToFrameSize_findByName(item, name, depth) {
36
+ if (depth > 32) {
37
+ return null;
38
+ }
39
+ try {
40
+ if (item.name === name) {
41
+ return item;
42
+ }
43
+ } catch (e) {
44
+ // fall through
45
+ }
46
+ if (item.children && item.children.numItems > 0) {
47
+ for (var i = 0; i < item.children.numItems; i++) {
48
+ var found = ppbSetScaleToFrameSize_findByName(item.children[i], name, depth + 1);
49
+ if (found) {
50
+ return found;
51
+ }
52
+ }
53
+ }
54
+ return null;
55
+ }
56
+
57
+ function ppb_setScaleToFrameSize(argsJson) {
58
+ try {
59
+ var args;
60
+ try {
61
+ args = JSON.parse(argsJson);
62
+ } catch (e) {
63
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
64
+ }
65
+
66
+ var hasNodeId = typeof args.nodeId === "string" && args.nodeId.length > 0;
67
+ var hasName = typeof args.name === "string" && args.name.length > 0;
68
+ if (!hasNodeId && !hasName) {
69
+ return JSON.stringify({ ok: false, error: "either nodeId or name is required" });
70
+ }
71
+
72
+ if (!app.project) {
73
+ return JSON.stringify({ ok: false, error: "no project open" });
74
+ }
75
+
76
+ var item = hasNodeId
77
+ ? ppbSetScaleToFrameSize_findByNodeId(app.project.rootItem, args.nodeId, 0)
78
+ : ppbSetScaleToFrameSize_findByName(app.project.rootItem, args.name, 0);
79
+ if (!item) {
80
+ return JSON.stringify({ ok: false, error: "no project item found matching the given nodeId/name" });
81
+ }
82
+
83
+ try {
84
+ item.setScaleToFrameSize();
85
+ } catch (e) {
86
+ return JSON.stringify({ ok: false, error: "setScaleToFrameSize() failed: " + e.toString() });
87
+ }
88
+
89
+ return JSON.stringify({
90
+ ok: true,
91
+ result: {
92
+ nodeId: item.nodeId,
93
+ name: item.name,
94
+ called: true,
95
+ note: "setScaleToFrameSize() has no confirmed getter to read the flag back — this only confirms the call didn't throw"
96
+ }
97
+ });
98
+ } catch (e) {
99
+ return JSON.stringify({ ok: false, error: e.toString() });
100
+ }
101
+ }
@@ -0,0 +1,140 @@
1
+ // Command: set-scale-width-height → ppb_setScaleWidthHeight
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_scale_width_height` tool (track-targeting.ts),
8
+ // addressed here by trackType/trackIndex/clipIndex (same convention as
9
+ // get-full-clip-info) instead of node_id. Sets the Motion component's
10
+ // Scale Width and/or Scale Height properties independently — this ONLY
11
+ // takes effect while Uniform Scale is off. Unlike the reference tool
12
+ // (which silently force-disables Uniform Scale before writing), this
13
+ // command reads Uniform Scale first and fails with an informative error if
14
+ // it's on, so a caller never gets a silent no-op — see set-uniform-scale
15
+ // to turn it off first. Mutating — undo is non-functional on this build,
16
+ // so previousValue in the result is the caller's only restoration path.
17
+
18
+ function ppb_setScaleWidthHeight(argsJson) {
19
+ try {
20
+ var args;
21
+ try {
22
+ args = JSON.parse(argsJson);
23
+ } catch (e) {
24
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
25
+ }
26
+
27
+ if (args.trackType !== "video" && args.trackType !== "audio") {
28
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
29
+ }
30
+ if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
31
+ return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
32
+ }
33
+ if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
34
+ return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
35
+ }
36
+ var hasWidth = typeof args.scaleWidth === "number";
37
+ var hasHeight = typeof args.scaleHeight === "number";
38
+ if (!hasWidth && !hasHeight) {
39
+ return JSON.stringify({ ok: false, error: "at least one of scaleWidth or scaleHeight is required" });
40
+ }
41
+
42
+ if (!app.project) {
43
+ return JSON.stringify({ ok: false, error: "no project open" });
44
+ }
45
+
46
+ var seq = null;
47
+ if (args.sequenceName && typeof args.sequenceName === "string") {
48
+ seq = findSequenceByName(args.sequenceName);
49
+ if (!seq) {
50
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
51
+ }
52
+ } else {
53
+ seq = app.project.activeSequence;
54
+ if (!seq) {
55
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
56
+ }
57
+ }
58
+
59
+ var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
60
+ var numTracks = trackCollection.numTracks;
61
+ if (args.trackIndex >= numTracks) {
62
+ return JSON.stringify({
63
+ ok: false,
64
+ error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
65
+ });
66
+ }
67
+
68
+ var track = trackCollection[args.trackIndex];
69
+ var numClips = track.clips.numItems;
70
+ if (args.clipIndex >= numClips) {
71
+ return JSON.stringify({
72
+ ok: false,
73
+ error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
74
+ });
75
+ }
76
+
77
+ var clip = track.clips[args.clipIndex];
78
+ var clipName = null;
79
+ try { clipName = clip.name; } catch (e) { clipName = null; }
80
+
81
+ var motion = findClipComponent(clip, ["AE.ADBE Motion"], ["Motion"]);
82
+ if (!motion) {
83
+ return JSON.stringify({ ok: false, error: "Motion component not found on clip" });
84
+ }
85
+
86
+ var uniformScaleProp = findComponentProperty(motion, ["Uniform Scale"]);
87
+ if (!uniformScaleProp) {
88
+ return JSON.stringify({ ok: false, error: "Uniform Scale property not found on the Motion component — cannot verify it is safe to set Scale Width/Height independently" });
89
+ }
90
+ var uniformScaleValue = null;
91
+ try { uniformScaleValue = uniformScaleProp.getValue(); } catch (e) { uniformScaleValue = null; }
92
+ if (uniformScaleValue === true || uniformScaleValue === 1) {
93
+ return JSON.stringify({
94
+ ok: false,
95
+ error: "Uniform Scale is currently ON — Scale Width/Scale Height cannot be set independently while it's on. Call set-uniform-scale with uniform:false first."
96
+ });
97
+ }
98
+
99
+ var result = {
100
+ sequenceName: seq.name,
101
+ trackType: args.trackType,
102
+ trackIndex: args.trackIndex,
103
+ clipIndex: args.clipIndex,
104
+ clipName: clipName
105
+ };
106
+
107
+ if (hasWidth) {
108
+ var widthResult = setComponentProperty(motion, ["Scale Width"], args.scaleWidth);
109
+ if (!widthResult.found) {
110
+ return JSON.stringify({ ok: false, error: "Scale Width property not found on the Motion component" });
111
+ }
112
+ result.scaleWidth = {
113
+ previousValue: widthResult.previousValue,
114
+ requestedValue: widthResult.requestedValue,
115
+ newValue: widthResult.newValue,
116
+ verified: widthResult.verified
117
+ };
118
+ }
119
+
120
+ if (hasHeight) {
121
+ // Live-discovered 2026-07-17: the Motion component has NO "Scale
122
+ // Height" property on this build — with Uniform Scale off, the plain
123
+ // "Scale" property IS the height, and "Scale Width" is the width.
124
+ var heightResult = setComponentProperty(motion, ["Scale", "Scale Height"], args.scaleHeight);
125
+ if (!heightResult.found) {
126
+ return JSON.stringify({ ok: false, error: "Scale (height) property not found on the Motion component" });
127
+ }
128
+ result.scaleHeight = {
129
+ previousValue: heightResult.previousValue,
130
+ requestedValue: heightResult.requestedValue,
131
+ newValue: heightResult.newValue,
132
+ verified: heightResult.verified
133
+ };
134
+ }
135
+
136
+ return JSON.stringify({ ok: true, result: result });
137
+ } catch (e) {
138
+ return JSON.stringify({ ok: false, error: e.toString() });
139
+ }
140
+ }