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: import-ae-comps → ppb_importAeComps
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context.
4
+ //
5
+ // Ported from leancoderkavy/premiere-pro-mcp's project.ts import_ae_comps.
6
+ // Calls app.project.importAEComps(aep, [names], bin) if compNames is
7
+ // given, else app.project.importAllAEComps(aep, bin) — both per
8
+ // PREMIERE_API_NOTES.md's Project/bins/import section. targetBinPath
9
+ // resolves via the same '/'-separated-path bin walk as get-bin-contents.
10
+ // jsx (never auto-created — must already exist); omitted defaults to
11
+ // app.project.rootItem. Verified by a target-bin children-count increase
12
+ // (never trusting the call's own return value).
13
+ //
14
+ // Helper names prefixed ppbImportAeComps_ to avoid colliding with
15
+ // same-purpose helpers in other lazily-loaded command files evaluated
16
+ // into this same global context.
17
+
18
+ function ppbImportAeComps_isBin(item) {
19
+ try {
20
+ return typeof ProjectItemType !== "undefined" && item.type === ProjectItemType.BIN;
21
+ } catch (e) {
22
+ return false;
23
+ }
24
+ }
25
+
26
+ function ppbImportAeComps_findBin(binPath) {
27
+ var segments = binPath.split("/").filter(function (s) { return s.length > 0; });
28
+ var current = app.project.rootItem;
29
+
30
+ for (var i = 0; i < segments.length; i++) {
31
+ var segment = segments[i];
32
+ var found = null;
33
+
34
+ for (var j = 0; j < current.children.numItems; j++) {
35
+ var child = current.children[j];
36
+ if (child.name === segment && ppbImportAeComps_isBin(child)) {
37
+ found = child;
38
+ break;
39
+ }
40
+ }
41
+
42
+ if (!found) {
43
+ return null;
44
+ }
45
+ current = found;
46
+ }
47
+
48
+ return current;
49
+ }
50
+
51
+ function ppb_importAeComps(argsJson) {
52
+ try {
53
+ var args;
54
+ try {
55
+ args = JSON.parse(argsJson);
56
+ } catch (e) {
57
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
58
+ }
59
+
60
+ if (!args.aepPath || typeof args.aepPath !== "string") {
61
+ return JSON.stringify({ ok: false, error: "aepPath is required" });
62
+ }
63
+
64
+ var file = new File(args.aepPath);
65
+ if (!file.exists) {
66
+ return JSON.stringify({ ok: false, error: "no file exists at aepPath: " + args.aepPath });
67
+ }
68
+
69
+ if (!app.project) {
70
+ return JSON.stringify({ ok: false, error: "no project open" });
71
+ }
72
+
73
+ var targetBin = app.project.rootItem;
74
+ if (args.targetBinPath && typeof args.targetBinPath === "string") {
75
+ var found = ppbImportAeComps_findBin(args.targetBinPath);
76
+ if (!found) {
77
+ return JSON.stringify({ ok: false, error: "no bin found at targetBinPath \"" + args.targetBinPath + "\"" });
78
+ }
79
+ targetBin = found;
80
+ }
81
+
82
+ var hasNames = Object.prototype.toString.call(args.compNames) === "[object Array]" && args.compNames.length > 0;
83
+
84
+ var countBefore = targetBin.children.numItems;
85
+
86
+ try {
87
+ if (hasNames) {
88
+ if (typeof app.project.importAEComps !== "function") {
89
+ return JSON.stringify({ ok: false, error: "importAEComps is not available on this Premiere build" });
90
+ }
91
+ app.project.importAEComps(args.aepPath, args.compNames, targetBin);
92
+ } else {
93
+ if (typeof app.project.importAllAEComps !== "function") {
94
+ return JSON.stringify({ ok: false, error: "importAllAEComps is not available on this Premiere build" });
95
+ }
96
+ app.project.importAllAEComps(args.aepPath, targetBin);
97
+ }
98
+ } catch (e) {
99
+ return JSON.stringify({ ok: false, error: "AE comp import failed: " + e.toString() });
100
+ }
101
+
102
+ var countAfter = targetBin.children.numItems;
103
+ var imported = countAfter > countBefore;
104
+
105
+ if (!imported) {
106
+ return JSON.stringify({
107
+ ok: false,
108
+ error: "the import call did not throw, but the target bin's item count did not increase",
109
+ countBefore: countBefore,
110
+ countAfter: countAfter
111
+ });
112
+ }
113
+
114
+ return JSON.stringify({
115
+ ok: true,
116
+ result: {
117
+ imported: true,
118
+ aepPath: args.aepPath,
119
+ compNames: hasNames ? args.compNames : null,
120
+ allComps: !hasNames,
121
+ targetBinPath: args.targetBinPath || null,
122
+ countBefore: countBefore,
123
+ countAfter: countAfter
124
+ }
125
+ });
126
+ } catch (e) {
127
+ return JSON.stringify({ ok: false, error: e.toString() });
128
+ }
129
+ }
@@ -0,0 +1,103 @@
1
+ // Command: import-fcp-xml → ppb_importFcpXml
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context.
4
+ //
5
+ // Ported from leancoderkavy/premiere-pro-mcp's project.ts import_fcp_xml,
6
+ // which uses the legacy app.openFCPXML(path). PREMIERE_API_NOTES.md's
7
+ // Sequences table flags this as legacy and recommends
8
+ // app.project.importFiles([xmlPath], false, rootItem, false) instead
9
+ // [hetpatel] — so this command tries importFiles first (verified by a
10
+ // root-bin children-count increase, same pattern as create-smart-bin.jsx),
11
+ // falling back to app.openFCPXML() if importFiles isn't available or
12
+ // doesn't visibly add anything. DIALOG RISK: both paths can pop blocking
13
+ // dialogs on malformed/unsupported XML (same caveat as open-project.jsx
14
+ // and PREMIERE_API_NOTES.md's Import section) — a hang here likely means
15
+ // a dialog needs dismissing in Premiere itself.
16
+
17
+ function ppb_importFcpXml(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 (!args.xmlPath || typeof args.xmlPath !== "string") {
27
+ return JSON.stringify({ ok: false, error: "xmlPath is required" });
28
+ }
29
+
30
+ var file = new File(args.xmlPath);
31
+ if (!file.exists) {
32
+ return JSON.stringify({ ok: false, error: "no file exists at xmlPath: " + args.xmlPath });
33
+ }
34
+
35
+ if (!app.project) {
36
+ return JSON.stringify({ ok: false, error: "no project open" });
37
+ }
38
+
39
+ var countBefore = app.project.rootItem.children.numItems;
40
+ var attempts = [];
41
+ var method = null;
42
+
43
+ if (typeof app.project.importFiles === "function") {
44
+ try {
45
+ app.project.importFiles([args.xmlPath], false, app.project.rootItem, false);
46
+ var countAfterImportFiles = app.project.rootItem.children.numItems;
47
+ var success1 = countAfterImportFiles > countBefore;
48
+ attempts.push({ method: "importFiles", success: success1 });
49
+ if (success1) {
50
+ method = "importFiles";
51
+ }
52
+ } catch (e) {
53
+ attempts.push({ method: "importFiles", success: false, error: e.toString() });
54
+ }
55
+ } else {
56
+ attempts.push({ method: "importFiles", success: false, error: "app.project.importFiles is not a function on this Premiere build" });
57
+ }
58
+
59
+ if (method === null) {
60
+ if (typeof app.openFCPXML === "function") {
61
+ try {
62
+ app.openFCPXML(args.xmlPath);
63
+ var countAfterOpenFCPXML = app.project.rootItem.children.numItems;
64
+ var success2 = countAfterOpenFCPXML > countBefore;
65
+ attempts.push({ method: "openFCPXML", success: success2 });
66
+ if (success2) {
67
+ method = "openFCPXML";
68
+ }
69
+ } catch (e) {
70
+ attempts.push({ method: "openFCPXML", success: false, error: e.toString() });
71
+ }
72
+ } else {
73
+ attempts.push({ method: "openFCPXML", success: false, error: "app.openFCPXML is not a function on this Premiere build" });
74
+ }
75
+ }
76
+
77
+ var countAfter = app.project.rootItem.children.numItems;
78
+
79
+ if (method === null) {
80
+ return JSON.stringify({
81
+ ok: false,
82
+ error: "could not import the FCP XML with any known method — see attempts",
83
+ attempts: attempts,
84
+ countBefore: countBefore,
85
+ countAfter: countAfter
86
+ });
87
+ }
88
+
89
+ return JSON.stringify({
90
+ ok: true,
91
+ result: {
92
+ imported: true,
93
+ xmlPath: args.xmlPath,
94
+ method: method,
95
+ countBefore: countBefore,
96
+ countAfter: countAfter,
97
+ attempts: attempts
98
+ }
99
+ });
100
+ } catch (e) {
101
+ return JSON.stringify({ ok: false, error: e.toString() });
102
+ }
103
+ }
@@ -0,0 +1,193 @@
1
+ // Command: import-folder → ppb_importFolder
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 import_folder tool. Same
7
+ // extension-allowlist/nodeId-diff verification approach as import-media.jsx
8
+ // (see that file's header for the dialog-freeze rationale) — duplicated
9
+ // here under its own prefix since each lazily-loaded command file cannot
10
+ // rely on helpers defined only in another command file.
11
+
12
+ var PPB_IMPORT_FOLDER_ALLOWED_EXTENSIONS = [
13
+ "mp4", "mov", "avi", "mkv", "webm", "mxf", "m4v", "wmv", "mpg", "mpeg",
14
+ "wav", "mp3", "aac", "m4a", "aif", "aiff", "flac", "ogg",
15
+ "png", "jpg", "jpeg", "gif", "tiff", "tif", "bmp", "psd", "tga", "exr", "dpx", "webp",
16
+ "prproj"
17
+ ];
18
+
19
+ function ppbImportFolder_extensionOf(path) {
20
+ var lastDot = path.lastIndexOf(".");
21
+ if (lastDot === -1 || lastDot === path.length - 1) {
22
+ return "";
23
+ }
24
+ return path.substring(lastDot + 1).toLowerCase();
25
+ }
26
+
27
+ function ppbImportFolder_isAllowedExtension(path) {
28
+ var ext = ppbImportFolder_extensionOf(path);
29
+ for (var i = 0; i < PPB_IMPORT_FOLDER_ALLOWED_EXTENSIONS.length; i++) {
30
+ if (ext === PPB_IMPORT_FOLDER_ALLOWED_EXTENSIONS[i]) {
31
+ return true;
32
+ }
33
+ }
34
+ return false;
35
+ }
36
+
37
+ function ppbImportFolder_snapshotNodeIds(item, depth, seen) {
38
+ if (depth > 32) {
39
+ return;
40
+ }
41
+ try {
42
+ if (item.nodeId) {
43
+ seen[item.nodeId] = true;
44
+ }
45
+ } catch (e) {
46
+ // ignore
47
+ }
48
+ if (item.children && item.children.numItems > 0) {
49
+ for (var i = 0; i < item.children.numItems; i++) {
50
+ ppbImportFolder_snapshotNodeIds(item.children[i], depth + 1, seen);
51
+ }
52
+ }
53
+ }
54
+
55
+ function ppbImportFolder_takeSnapshot() {
56
+ var seen = {};
57
+ ppbImportFolder_snapshotNodeIds(app.project.rootItem, 0, seen);
58
+ return seen;
59
+ }
60
+
61
+ function ppbImportFolder_collectNew(item, depth, beforeSnapshot, out) {
62
+ if (depth > 32) {
63
+ return;
64
+ }
65
+ try {
66
+ if (item.nodeId && !beforeSnapshot[item.nodeId]) {
67
+ var entry = { name: null, nodeId: null, treePath: null, mediaPath: null };
68
+ try { entry.name = item.name; } catch (e) { entry.name = null; }
69
+ try { entry.nodeId = item.nodeId; } catch (e) { entry.nodeId = null; }
70
+ try { entry.treePath = item.treePath; } catch (e) { entry.treePath = null; }
71
+ try { entry.mediaPath = item.getMediaPath(); } catch (e) { entry.mediaPath = null; }
72
+ out.push(entry);
73
+ }
74
+ } catch (e) {
75
+ // ignore
76
+ }
77
+ if (item.children && item.children.numItems > 0) {
78
+ for (var i = 0; i < item.children.numItems; i++) {
79
+ ppbImportFolder_collectNew(item.children[i], depth + 1, beforeSnapshot, out);
80
+ }
81
+ }
82
+ }
83
+
84
+ function ppbImportFolder_resolveBinPath(binPath) {
85
+ var segments = binPath.split("/").filter(function (s) { return s.length > 0; });
86
+ var current = app.project.rootItem;
87
+ for (var i = 0; i < segments.length; i++) {
88
+ var found = null;
89
+ for (var j = 0; j < current.children.numItems; j++) {
90
+ var child = current.children[j];
91
+ if (child.name === segments[i] && typeof ProjectItemType !== "undefined" && child.type === ProjectItemType.BIN) {
92
+ found = child;
93
+ break;
94
+ }
95
+ }
96
+ if (!found) {
97
+ return { error: "bin path segment \"" + segments[i] + "\" not found in \"" + binPath + "\" (target bin must already exist)" };
98
+ }
99
+ current = found;
100
+ }
101
+ return { bin: current };
102
+ }
103
+
104
+ function ppb_importFolder(argsJson) {
105
+ try {
106
+ var args;
107
+ try {
108
+ args = JSON.parse(argsJson);
109
+ } catch (e) {
110
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
111
+ }
112
+
113
+ if (!args.folderPath || typeof args.folderPath !== "string") {
114
+ return JSON.stringify({ ok: false, error: "folderPath is required" });
115
+ }
116
+
117
+ if (!app.project) {
118
+ return JSON.stringify({ ok: false, error: "no project open" });
119
+ }
120
+
121
+ var folder = new Folder(args.folderPath);
122
+ if (!folder.exists) {
123
+ return JSON.stringify({ ok: false, error: "folder not found: " + args.folderPath });
124
+ }
125
+
126
+ var files = folder.getFiles();
127
+ var candidatePaths = [];
128
+ for (var i = 0; i < files.length; i++) {
129
+ if (files[i] instanceof File) {
130
+ candidatePaths.push(files[i].fsName);
131
+ }
132
+ }
133
+
134
+ if (candidatePaths.length === 0) {
135
+ return JSON.stringify({ ok: false, error: "no files found in folder: " + args.folderPath });
136
+ }
137
+
138
+ var allowed = [];
139
+ var refused = [];
140
+ for (var p = 0; p < candidatePaths.length; p++) {
141
+ if (ppbImportFolder_isAllowedExtension(candidatePaths[p])) {
142
+ allowed.push(candidatePaths[p]);
143
+ } else {
144
+ refused.push(candidatePaths[p]);
145
+ }
146
+ }
147
+
148
+ if (allowed.length === 0) {
149
+ return JSON.stringify({
150
+ ok: false,
151
+ error: "refusing to import — none of the folder's files have a recognized extension (an unsupported " +
152
+ "format can pop a BLOCKING dialog that freezes the Premiere Bridge panel)",
153
+ refused: refused,
154
+ allowedExtensions: PPB_IMPORT_FOLDER_ALLOWED_EXTENSIONS
155
+ });
156
+ }
157
+
158
+ var targetBin = app.project.rootItem;
159
+ if (typeof args.targetBinPath === "string" && args.targetBinPath.length > 0) {
160
+ var resolved = ppbImportFolder_resolveBinPath(args.targetBinPath);
161
+ if (resolved.error) {
162
+ return JSON.stringify({ ok: false, error: resolved.error });
163
+ }
164
+ targetBin = resolved.bin;
165
+ }
166
+
167
+ var before = ppbImportFolder_takeSnapshot();
168
+
169
+ try {
170
+ app.project.importFiles(allowed, true, targetBin, false);
171
+ } catch (e) {
172
+ return JSON.stringify({ ok: false, error: "app.project.importFiles() threw: " + e.toString() });
173
+ }
174
+
175
+ var imported = [];
176
+ ppbImportFolder_collectNew(app.project.rootItem, 0, before, imported);
177
+
178
+ return JSON.stringify({
179
+ ok: true,
180
+ result: {
181
+ folderPath: args.folderPath,
182
+ targetBinPath: args.targetBinPath || null,
183
+ candidateCount: candidatePaths.length,
184
+ refusedCount: refused.length,
185
+ refused: refused,
186
+ importedCount: imported.length,
187
+ imported: imported
188
+ }
189
+ });
190
+ } catch (e) {
191
+ return JSON.stringify({ ok: false, error: e.toString() });
192
+ }
193
+ }
@@ -0,0 +1,171 @@
1
+ // Command: import-image-sequence → ppb_importImageSequence
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 track-targeting.ts import_image_sequence
7
+ // tool. Imports a numbered image sequence as ONE clip via importFiles'
8
+ // 4th argument (asNumberedStills=true) per PREMIERE_API_NOTES.md. Same
9
+ // extension-allowlist/nodeId-diff verification approach as import-media.jsx
10
+ // (see that file's header) — duplicated under its own prefix since each
11
+ // lazily-loaded command file cannot rely on helpers defined only in
12
+ // another command file. Only the first frame's path is passed to
13
+ // importFiles(); Premiere itself detects the numbered sibling frames.
14
+
15
+ var PPB_IMPORT_IMAGE_SEQUENCE_ALLOWED_EXTENSIONS = [
16
+ "png", "jpg", "jpeg", "gif", "tiff", "tif", "bmp", "psd", "tga", "exr", "dpx", "webp"
17
+ ];
18
+
19
+ function ppbImportImageSequence_extensionOf(path) {
20
+ var lastDot = path.lastIndexOf(".");
21
+ if (lastDot === -1 || lastDot === path.length - 1) {
22
+ return "";
23
+ }
24
+ return path.substring(lastDot + 1).toLowerCase();
25
+ }
26
+
27
+ function ppbImportImageSequence_isAllowedExtension(path) {
28
+ var ext = ppbImportImageSequence_extensionOf(path);
29
+ for (var i = 0; i < PPB_IMPORT_IMAGE_SEQUENCE_ALLOWED_EXTENSIONS.length; i++) {
30
+ if (ext === PPB_IMPORT_IMAGE_SEQUENCE_ALLOWED_EXTENSIONS[i]) {
31
+ return true;
32
+ }
33
+ }
34
+ return false;
35
+ }
36
+
37
+ function ppbImportImageSequence_snapshotNodeIds(item, depth, seen) {
38
+ if (depth > 32) {
39
+ return;
40
+ }
41
+ try {
42
+ if (item.nodeId) {
43
+ seen[item.nodeId] = true;
44
+ }
45
+ } catch (e) {
46
+ // ignore
47
+ }
48
+ if (item.children && item.children.numItems > 0) {
49
+ for (var i = 0; i < item.children.numItems; i++) {
50
+ ppbImportImageSequence_snapshotNodeIds(item.children[i], depth + 1, seen);
51
+ }
52
+ }
53
+ }
54
+
55
+ function ppbImportImageSequence_takeSnapshot() {
56
+ var seen = {};
57
+ ppbImportImageSequence_snapshotNodeIds(app.project.rootItem, 0, seen);
58
+ return seen;
59
+ }
60
+
61
+ function ppbImportImageSequence_collectNew(item, depth, beforeSnapshot, out) {
62
+ if (depth > 32) {
63
+ return;
64
+ }
65
+ try {
66
+ if (item.nodeId && !beforeSnapshot[item.nodeId]) {
67
+ var entry = { name: null, nodeId: null, treePath: null, mediaPath: null };
68
+ try { entry.name = item.name; } catch (e) { entry.name = null; }
69
+ try { entry.nodeId = item.nodeId; } catch (e) { entry.nodeId = null; }
70
+ try { entry.treePath = item.treePath; } catch (e) { entry.treePath = null; }
71
+ try { entry.mediaPath = item.getMediaPath(); } catch (e) { entry.mediaPath = null; }
72
+ out.push(entry);
73
+ }
74
+ } catch (e) {
75
+ // ignore
76
+ }
77
+ if (item.children && item.children.numItems > 0) {
78
+ for (var i = 0; i < item.children.numItems; i++) {
79
+ ppbImportImageSequence_collectNew(item.children[i], depth + 1, beforeSnapshot, out);
80
+ }
81
+ }
82
+ }
83
+
84
+ function ppbImportImageSequence_resolveBinPath(binPath) {
85
+ var segments = binPath.split("/").filter(function (s) { return s.length > 0; });
86
+ var current = app.project.rootItem;
87
+ for (var i = 0; i < segments.length; i++) {
88
+ var found = null;
89
+ for (var j = 0; j < current.children.numItems; j++) {
90
+ var child = current.children[j];
91
+ if (child.name === segments[i] && typeof ProjectItemType !== "undefined" && child.type === ProjectItemType.BIN) {
92
+ found = child;
93
+ break;
94
+ }
95
+ }
96
+ if (!found) {
97
+ return { error: "bin path segment \"" + segments[i] + "\" not found in \"" + binPath + "\" (target bin must already exist)" };
98
+ }
99
+ current = found;
100
+ }
101
+ return { bin: current };
102
+ }
103
+
104
+ function ppb_importImageSequence(argsJson) {
105
+ try {
106
+ var args;
107
+ try {
108
+ args = JSON.parse(argsJson);
109
+ } catch (e) {
110
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
111
+ }
112
+
113
+ if (!args.firstFramePath || typeof args.firstFramePath !== "string") {
114
+ return JSON.stringify({ ok: false, error: "firstFramePath is required" });
115
+ }
116
+
117
+ if (!app.project) {
118
+ return JSON.stringify({ ok: false, error: "no project open" });
119
+ }
120
+
121
+ if (!ppbImportImageSequence_isAllowedExtension(args.firstFramePath)) {
122
+ return JSON.stringify({
123
+ ok: false,
124
+ error: "refusing to import — firstFramePath does not have a recognized image extension (an unsupported " +
125
+ "format can pop a BLOCKING dialog that freezes the Premiere Bridge panel): " + args.firstFramePath,
126
+ allowedExtensions: PPB_IMPORT_IMAGE_SEQUENCE_ALLOWED_EXTENSIONS
127
+ });
128
+ }
129
+
130
+ var targetBin = app.project.rootItem;
131
+ if (typeof args.targetBinPath === "string" && args.targetBinPath.length > 0) {
132
+ var resolved = ppbImportImageSequence_resolveBinPath(args.targetBinPath);
133
+ if (resolved.error) {
134
+ return JSON.stringify({ ok: false, error: resolved.error });
135
+ }
136
+ targetBin = resolved.bin;
137
+ }
138
+
139
+ var before = ppbImportImageSequence_takeSnapshot();
140
+
141
+ try {
142
+ app.project.importFiles([args.firstFramePath], true, targetBin, true);
143
+ } catch (e) {
144
+ return JSON.stringify({ ok: false, error: "app.project.importFiles() threw: " + e.toString() });
145
+ }
146
+
147
+ var imported = [];
148
+ ppbImportImageSequence_collectNew(app.project.rootItem, 0, before, imported);
149
+
150
+ if (imported.length === 0) {
151
+ return JSON.stringify({
152
+ ok: false,
153
+ error: "importFiles() did not throw, but no new project item appeared (nodeId-diff found nothing)",
154
+ firstFramePath: args.firstFramePath
155
+ });
156
+ }
157
+
158
+ return JSON.stringify({
159
+ ok: true,
160
+ result: {
161
+ firstFramePath: args.firstFramePath,
162
+ targetBinPath: args.targetBinPath || null,
163
+ asNumberedStills: true,
164
+ importedCount: imported.length,
165
+ imported: imported
166
+ }
167
+ });
168
+ } catch (e) {
169
+ return JSON.stringify({ ok: false, error: e.toString() });
170
+ }
171
+ }