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,247 @@
1
+ // Command: get-project-item-info → ppb_getProjectItemInfo
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (TICKS_PER_SECOND,
4
+ // ensureQEEnabled, findSequenceByName, ...) are already defined there.
5
+ //
6
+ // Full detail on a single project item, identified by nodeId or treePath
7
+ // (at least one required). Merges the reference project's two near-
8
+ // duplicate tools (get_project_item_info in inspection.ts, get_item_info in
9
+ // media.ts) into one command — see the "Additional commands" doc note for
10
+ // why get-media-item-info was skipped. Helper names are prefixed
11
+ // ppbProjectItemInfo_ to avoid colliding with same-purpose helpers in other
12
+ // lazily-loaded command files evaluated into this same global context.
13
+
14
+ var PPB_PROJECT_ITEM_INFO_METADATA_MAX_CHARS = 10000;
15
+
16
+ function ppbProjectItemInfo_isBin(item) {
17
+ try {
18
+ return typeof ProjectItemType !== "undefined" && item.type === ProjectItemType.BIN;
19
+ } catch (e) {
20
+ return false;
21
+ }
22
+ }
23
+
24
+ function ppbProjectItemInfo_typeToString(item) {
25
+ try {
26
+ if (typeof ProjectItemType !== "undefined") {
27
+ if (item.type === ProjectItemType.BIN) {
28
+ return "BIN";
29
+ }
30
+ if (item.type === ProjectItemType.CLIP) {
31
+ return "CLIP";
32
+ }
33
+ if (item.type === ProjectItemType.FILE) {
34
+ return "FILE";
35
+ }
36
+ if (item.type === ProjectItemType.ROOT) {
37
+ return "ROOT";
38
+ }
39
+ }
40
+ } catch (e) {
41
+ // fall through to raw number below
42
+ }
43
+ return String(item.type);
44
+ }
45
+
46
+ // Capped at depth 32 to defend against pathological/circular bin
47
+ // structures rather than looping forever.
48
+ function ppbProjectItemInfo_findByNodeId(item, nodeId, depth) {
49
+ if (depth > 32) {
50
+ return null;
51
+ }
52
+ try {
53
+ if (item.nodeId === nodeId) {
54
+ return item;
55
+ }
56
+ } catch (e) {
57
+ // fall through
58
+ }
59
+ // Recurse into anything with children — the ROOT item's type is ROOT,
60
+ // not BIN, so an isBin() gate here would never descend past the root
61
+ // (live-debugged 2026-07-17: every lookup returned not-found).
62
+ if (item.children && item.children.numItems > 0) {
63
+ for (var i = 0; i < item.children.numItems; i++) {
64
+ var found = ppbProjectItemInfo_findByNodeId(item.children[i], nodeId, depth + 1);
65
+ if (found) {
66
+ return found;
67
+ }
68
+ }
69
+ }
70
+ return null;
71
+ }
72
+
73
+ // Capped at depth 32, same reasoning as ppbProjectItemInfo_findByNodeId.
74
+ function ppbProjectItemInfo_findByTreePath(item, treePath, depth) {
75
+ if (depth > 32) {
76
+ return null;
77
+ }
78
+ try {
79
+ if (item.treePath === treePath) {
80
+ return item;
81
+ }
82
+ } catch (e) {
83
+ // fall through
84
+ }
85
+ // Recurse into anything with children — the ROOT item's type is ROOT,
86
+ // not BIN, so an isBin() gate here would never descend past the root
87
+ // (live-debugged 2026-07-17: every lookup returned not-found).
88
+ if (item.children && item.children.numItems > 0) {
89
+ for (var i = 0; i < item.children.numItems; i++) {
90
+ var found = ppbProjectItemInfo_findByTreePath(item.children[i], treePath, depth + 1);
91
+ if (found) {
92
+ return found;
93
+ }
94
+ }
95
+ }
96
+ return null;
97
+ }
98
+
99
+ function ppb_getProjectItemInfo(argsJson) {
100
+ try {
101
+ var args;
102
+ try {
103
+ args = JSON.parse(argsJson);
104
+ } catch (e) {
105
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
106
+ }
107
+
108
+ var hasNodeId = typeof args.nodeId === "string" && args.nodeId.length > 0;
109
+ var hasTreePath = typeof args.treePath === "string" && args.treePath.length > 0;
110
+
111
+ if (!hasNodeId && !hasTreePath) {
112
+ return JSON.stringify({ ok: false, error: "one of nodeId or treePath is required" });
113
+ }
114
+
115
+ if (!app.project) {
116
+ return JSON.stringify({ ok: false, error: "no project open" });
117
+ }
118
+
119
+ var item = null;
120
+ var root = app.project.rootItem;
121
+ if (hasNodeId) {
122
+ item = ppbProjectItemInfo_findByNodeId(root, args.nodeId, 0);
123
+ if (!item) {
124
+ return JSON.stringify({ ok: false, error: "no project item found with nodeId \"" + args.nodeId + "\"" });
125
+ }
126
+ } else {
127
+ item = ppbProjectItemInfo_findByTreePath(root, args.treePath, 0);
128
+ if (!item) {
129
+ return JSON.stringify({ ok: false, error: "no project item found with treePath \"" + args.treePath + "\"" });
130
+ }
131
+ }
132
+
133
+ var info = {
134
+ nodeId: null,
135
+ name: null,
136
+ type: null,
137
+ treePath: null,
138
+ mediaPath: null,
139
+ isOffline: null,
140
+ colorLabel: null,
141
+ canChangeMediaPath: null,
142
+ isSequence: null,
143
+ isMulticamClip: null,
144
+ isMergedClip: null,
145
+ frameRate: null,
146
+ pixelAspectRatio: null,
147
+ fieldType: null,
148
+ alphaUsage: null,
149
+ ignoreAlpha: null,
150
+ invertAlpha: null,
151
+ inPointSeconds: null,
152
+ outPointSeconds: null,
153
+ hasProxy: null,
154
+ canProxy: null,
155
+ projectMetadata: null,
156
+ projectMetadataLength: null,
157
+ xmpMetadata: null,
158
+ xmpMetadataLength: null,
159
+ markers: [],
160
+ childCount: null
161
+ };
162
+
163
+ try { info.nodeId = item.nodeId; } catch (e) { info.nodeId = null; }
164
+ try { info.name = item.name; } catch (e) { info.name = null; }
165
+ try { info.type = ppbProjectItemInfo_typeToString(item); } catch (e) { info.type = null; }
166
+ try { info.treePath = item.treePath; } catch (e) { info.treePath = null; }
167
+ try { info.mediaPath = item.getMediaPath(); } catch (e) { info.mediaPath = null; }
168
+ try { info.isOffline = item.isOffline(); } catch (e) { info.isOffline = null; }
169
+ try { info.colorLabel = item.getColorLabel(); } catch (e) { info.colorLabel = null; }
170
+ try { info.canChangeMediaPath = item.canChangeMediaPath(); } catch (e) { info.canChangeMediaPath = null; }
171
+ try { info.isSequence = item.isSequence(); } catch (e) { info.isSequence = null; }
172
+ try { info.isMulticamClip = item.isMulticamClip(); } catch (e) { info.isMulticamClip = null; }
173
+ try { info.isMergedClip = item.isMergedClip(); } catch (e) { info.isMergedClip = null; }
174
+
175
+ try {
176
+ var interp = item.getFootageInterpretation();
177
+ if (interp) {
178
+ try { info.frameRate = interp.frameRate; } catch (e) { info.frameRate = null; }
179
+ try { info.pixelAspectRatio = interp.pixelAspectRatio; } catch (e) { info.pixelAspectRatio = null; }
180
+ try { info.fieldType = interp.fieldType; } catch (e) { info.fieldType = null; }
181
+ try { info.alphaUsage = interp.alphaUsage; } catch (e) { info.alphaUsage = null; }
182
+ try { info.ignoreAlpha = interp.ignoreAlpha; } catch (e) { info.ignoreAlpha = null; }
183
+ try { info.invertAlpha = interp.invertAlpha; } catch (e) { info.invertAlpha = null; }
184
+ }
185
+ } catch (e) {
186
+ // leave footage-interpretation fields null
187
+ }
188
+
189
+ try { info.inPointSeconds = timeValueToSeconds(item.getInPoint()); } catch (e) { info.inPointSeconds = null; }
190
+ try { info.outPointSeconds = timeValueToSeconds(item.getOutPoint()); } catch (e) { info.outPointSeconds = null; }
191
+
192
+ try { info.hasProxy = item.hasProxy(); } catch (e) { info.hasProxy = null; }
193
+ try { info.canProxy = item.canProxy(); } catch (e) { info.canProxy = null; }
194
+
195
+ try {
196
+ var xmp = item.getProjectMetadata();
197
+ if (xmp && xmp.length > PPB_PROJECT_ITEM_INFO_METADATA_MAX_CHARS) {
198
+ info.projectMetadataLength = xmp.length;
199
+ } else if (xmp) {
200
+ info.projectMetadata = xmp;
201
+ }
202
+ } catch (e) {
203
+ // leave projectMetadata fields null
204
+ }
205
+
206
+ try {
207
+ var xmp2 = item.getXMPMetadata();
208
+ if (xmp2 && xmp2.length > PPB_PROJECT_ITEM_INFO_METADATA_MAX_CHARS) {
209
+ info.xmpMetadataLength = xmp2.length;
210
+ } else if (xmp2) {
211
+ info.xmpMetadata = xmp2;
212
+ }
213
+ } catch (e) {
214
+ // leave xmpMetadata fields null
215
+ }
216
+
217
+ try {
218
+ var markerCollection = item.getMarkers();
219
+ if (markerCollection) {
220
+ var m = markerCollection.getFirstMarker();
221
+ while (m) {
222
+ var markerEntry = { name: null, comments: null, startSeconds: null, guid: null };
223
+ try { markerEntry.name = m.name; } catch (e) { markerEntry.name = null; }
224
+ try { markerEntry.guid = m.guid; } catch (e) { markerEntry.guid = null; }
225
+ try { markerEntry.comments = m.comments; } catch (e) { markerEntry.comments = null; }
226
+ try { markerEntry.startSeconds = timeValueToSeconds(m.start); } catch (e) { markerEntry.startSeconds = null; }
227
+ info.markers.push(markerEntry);
228
+ m = markerCollection.getNextMarker(m);
229
+ }
230
+ }
231
+ } catch (e) {
232
+ // leave markers as whatever was collected so far
233
+ }
234
+
235
+ if (ppbProjectItemInfo_isBin(item)) {
236
+ try {
237
+ info.childCount = item.children.numItems;
238
+ } catch (e) {
239
+ info.childCount = null;
240
+ }
241
+ }
242
+
243
+ return JSON.stringify({ ok: true, result: info });
244
+ } catch (e) {
245
+ return JSON.stringify({ ok: false, error: e.toString() });
246
+ }
247
+ }
@@ -0,0 +1,30 @@
1
+ // Command: get-project-panel-metadata → ppb_getProjectPanelMetadata
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (TICKS_PER_SECOND,
4
+ // ensureQEEnabled, findSequenceByName, ...) are already defined there.
5
+ //
6
+ // Thin read of app.project.getProjectPanelMetadata() — the Project panel's
7
+ // column/metadata configuration, returned as an XML string.
8
+
9
+ function ppb_getProjectPanelMetadata(argsJson) {
10
+ try {
11
+ if (!app.project) {
12
+ return JSON.stringify({ ok: false, error: "no project open" });
13
+ }
14
+
15
+ var metadata = null;
16
+ try {
17
+ metadata = app.project.getProjectPanelMetadata();
18
+ } catch (e) {
19
+ return JSON.stringify({ ok: false, error: "getProjectPanelMetadata failed: " + e.toString() });
20
+ }
21
+
22
+ if (!metadata) {
23
+ return JSON.stringify({ ok: false, error: "could not retrieve project panel metadata" });
24
+ }
25
+
26
+ return JSON.stringify({ ok: true, result: { metadata: metadata } });
27
+ } catch (e) {
28
+ return JSON.stringify({ ok: false, error: e.toString() });
29
+ }
30
+ }
@@ -0,0 +1,198 @@
1
+ // Command: get-qe-clip-info → ppb_getQeClipInfo
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context — shared helpers (ensureQEEnabled,
4
+ // findSequenceByName, ...) are already defined there.
5
+ //
6
+ // QE DOM read — undocumented, version-dependent surface (see
7
+ // PREMIERE_API_NOTES.md). QE items expose `.secs` on their time-like
8
+ // properties, NOT `.seconds` like the standard DOM (ayushozha's finding,
9
+ // confirmed in our notes) — qeTimeToSeconds below handles that. QE DOM
10
+ // operates on qe.project.getActiveSequence() only, so this command
11
+ // activates the resolved sequence first, same as remove-track-intervals.
12
+ // Clip addressing (trackType/trackIndex/clipIndex) is validated against
13
+ // the standard DOM's track/clip counts first — same range-check pattern
14
+ // as get-full-clip-info — since the QE track/clip API surfaces no count
15
+ // validation of its own. Ported from leancoderkavy's premiere-pro-mcp
16
+ // `get_qe_clip_info` tool (track-targeting.ts).
17
+
18
+ var GET_QE_CLIP_INFO_PROPS = [
19
+ "name", "type", "mediaType", "duration", "start", "end", "inPoint", "outPoint",
20
+ "speed", "audioChannelType", "numAudioChannels"
21
+ ];
22
+
23
+ function qeTimeToSeconds(timeLike) {
24
+ if (timeLike === null || typeof timeLike === "undefined") {
25
+ return null;
26
+ }
27
+ if (typeof timeLike === "number") {
28
+ return timeLike;
29
+ }
30
+ if (typeof timeLike.secs === "number") {
31
+ return timeLike.secs;
32
+ }
33
+ if (typeof timeLike.seconds === "number") {
34
+ return timeLike.seconds;
35
+ }
36
+ if (typeof timeLike.ticks !== "undefined") {
37
+ return Number(timeLike.ticks) / TICKS_PER_SECOND;
38
+ }
39
+ return null;
40
+ }
41
+
42
+ function ppb_getQeClipInfo(argsJson) {
43
+ try {
44
+ var args;
45
+ try {
46
+ args = JSON.parse(argsJson);
47
+ } catch (e) {
48
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
49
+ }
50
+
51
+ if (args.trackType !== "video" && args.trackType !== "audio") {
52
+ return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
53
+ }
54
+ if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
55
+ return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
56
+ }
57
+ if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
58
+ return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
59
+ }
60
+
61
+ if (!app.project) {
62
+ return JSON.stringify({ ok: false, error: "no project open" });
63
+ }
64
+
65
+ var seq = null;
66
+ if (args.sequenceName && typeof args.sequenceName === "string") {
67
+ seq = findSequenceByName(args.sequenceName);
68
+ if (!seq) {
69
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
70
+ }
71
+ } else {
72
+ seq = app.project.activeSequence;
73
+ if (!seq) {
74
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
75
+ }
76
+ }
77
+
78
+ var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
79
+ var numTracks = trackCollection.numTracks;
80
+ if (args.trackIndex >= numTracks) {
81
+ return JSON.stringify({
82
+ ok: false,
83
+ error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
84
+ });
85
+ }
86
+ var numClips = trackCollection[args.trackIndex].clips.numItems;
87
+ if (args.clipIndex >= numClips) {
88
+ return JSON.stringify({
89
+ ok: false,
90
+ error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
91
+ });
92
+ }
93
+
94
+ // QE DOM only ever operates on the active sequence tab — switch to it
95
+ // rather than erroring if the resolved sequence isn't already active.
96
+ if (app.project.activeSequence !== seq) {
97
+ app.project.activeSequence = seq;
98
+ }
99
+
100
+ try {
101
+ ensureQEEnabled();
102
+ } catch (e) {
103
+ return JSON.stringify({ ok: false, error: "app.enableQE() failed: " + e.toString() });
104
+ }
105
+ if (typeof qe === "undefined" || !qe.project) {
106
+ return JSON.stringify({ ok: false, error: "QE DOM not available after enableQE()" });
107
+ }
108
+
109
+ var qeSeq;
110
+ try {
111
+ qeSeq = qe.project.getActiveSequence();
112
+ } catch (e) {
113
+ return JSON.stringify({ ok: false, error: "qe.project.getActiveSequence() failed: " + e.toString() });
114
+ }
115
+ if (!qeSeq) {
116
+ return JSON.stringify({ ok: false, error: "qe.project.getActiveSequence() returned nothing after activating the sequence" });
117
+ }
118
+
119
+ var qeTrack;
120
+ try {
121
+ qeTrack = args.trackType === "video" ? qeSeq.getVideoTrackAt(args.trackIndex) : qeSeq.getAudioTrackAt(args.trackIndex);
122
+ } catch (e) {
123
+ return JSON.stringify({ ok: false, error: "QE track lookup failed: " + e.toString() });
124
+ }
125
+ if (!qeTrack) {
126
+ return JSON.stringify({ ok: false, error: "QE track not found at index " + args.trackIndex });
127
+ }
128
+
129
+ var qeClip;
130
+ try {
131
+ qeClip = qeTrack.getItemAt(args.clipIndex);
132
+ } catch (e) {
133
+ return JSON.stringify({ ok: false, error: "QE clip lookup failed: " + e.toString() });
134
+ }
135
+ if (!qeClip) {
136
+ return JSON.stringify({ ok: false, error: "QE clip not found at index " + args.clipIndex });
137
+ }
138
+
139
+ var result = {
140
+ sequenceName: seq.name,
141
+ trackType: args.trackType,
142
+ trackIndex: args.trackIndex,
143
+ clipIndex: args.clipIndex
144
+ };
145
+
146
+ var TIME_FIELDS = { duration: true, start: true, end: true, inPoint: true, outPoint: true };
147
+
148
+ for (var i = 0; i < GET_QE_CLIP_INFO_PROPS.length; i++) {
149
+ var propName = GET_QE_CLIP_INFO_PROPS[i];
150
+ try {
151
+ var raw = qeClip[propName];
152
+ if (TIME_FIELDS[propName]) {
153
+ result[propName + "Seconds"] = qeTimeToSeconds(raw);
154
+ } else {
155
+ result[propName] = raw;
156
+ }
157
+ } catch (e) {
158
+ // leave this field absent — best-effort per PPB_COMMANDS convention
159
+ }
160
+ }
161
+
162
+ var availableProperties = [];
163
+ try {
164
+ for (var key in qeClip) {
165
+ try {
166
+ if (typeof qeClip[key] !== "function") {
167
+ availableProperties.push(key);
168
+ }
169
+ } catch (e) {
170
+ // some QE keys throw on access — skip
171
+ }
172
+ }
173
+ } catch (e) {
174
+ // for-in itself failed — leave list empty
175
+ }
176
+ result.availableProperties = availableProperties;
177
+
178
+ var availableMethods = [];
179
+ try {
180
+ for (var mkey in qeClip) {
181
+ try {
182
+ if (typeof qeClip[mkey] === "function") {
183
+ availableMethods.push(mkey);
184
+ }
185
+ } catch (e) {
186
+ // some QE keys throw on access — skip
187
+ }
188
+ }
189
+ } catch (e) {
190
+ // for-in itself failed — leave list empty
191
+ }
192
+ result.availableMethods = availableMethods;
193
+
194
+ return JSON.stringify({ ok: true, result: result });
195
+ } catch (e) {
196
+ return JSON.stringify({ ok: false, error: e.toString() });
197
+ }
198
+ }
@@ -0,0 +1,35 @@
1
+ // Command: get-render-queue-status → ppb_getRenderQueueStatus
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
3
+ // same global ExtendScript context.
4
+ //
5
+ // Standard DOM only (app.encoder), no QE needed. Per PREMIERE_API_NOTES.md
6
+ // ("No progress API — fire and forget"), Adobe Media Encoder exposes no
7
+ // real queue-introspection API from ExtendScript — this surfaces whatever
8
+ // `app.encoder.isRunning()` reports (if the method exists on this
9
+ // Premiere build) rather than inventing queue detail that doesn't exist.
10
+
11
+ function ppb_getRenderQueueStatus(argsJson) {
12
+ try {
13
+ if (typeof app.encoder === "undefined" || !app.encoder) {
14
+ return JSON.stringify({ ok: false, error: "Adobe Media Encoder is not available (app.encoder is undefined)" });
15
+ }
16
+
17
+ var isRunning = null;
18
+ try {
19
+ if (typeof app.encoder.isRunning === "function") {
20
+ isRunning = app.encoder.isRunning();
21
+ }
22
+ } catch (e) {
23
+ isRunning = null;
24
+ }
25
+
26
+ var result = {
27
+ isRunning: isRunning,
28
+ info: "Premiere's ExtendScript API has no render-queue introspection — check Adobe Media Encoder itself for detailed job/progress status."
29
+ };
30
+
31
+ return JSON.stringify({ ok: true, result: result });
32
+ } catch (e) {
33
+ return JSON.stringify({ ok: false, error: e.toString() });
34
+ }
35
+ }
@@ -0,0 +1,24 @@
1
+ // Command: get-sequence-count → ppb_getSequenceCount
2
+ // Loaded lazily by ppb_dispatch (host/index.jsx) on first use.
3
+ //
4
+ // Standard-DOM read only, no args. Ported from leancoderkavy's
5
+ // premiere-pro-mcp `get_sequence_count` tool (utility.ts).
6
+
7
+ function ppb_getSequenceCount() {
8
+ try {
9
+ if (!app.project) {
10
+ return JSON.stringify({ ok: false, error: "no project open" });
11
+ }
12
+
13
+ var count = null;
14
+ try {
15
+ count = app.project.sequences.numSequences;
16
+ } catch (e) {
17
+ return JSON.stringify({ ok: false, error: "could not read sequence count: " + e.toString() });
18
+ }
19
+
20
+ return JSON.stringify({ ok: true, result: { count: count } });
21
+ } catch (e) {
22
+ return JSON.stringify({ ok: false, error: e.toString() });
23
+ }
24
+ }
@@ -0,0 +1,76 @@
1
+ // Command: get-sequence-in-out → ppb_getSequenceInOut
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
+ // findSequenceByName, timeValueToSeconds, ...) are already defined there.
5
+ //
6
+ // Ported from leancoderkavy/premiere-pro-mcp's playhead.ts
7
+ // get_sequence_in_out_points. Reads the given (or active) sequence's
8
+ // in/out points via seq.getInPoint()/getOutPoint().
9
+ //
10
+ // Live-tested 2026-07-17 on Premiere Pro 2026: getInPoint()/getOutPoint()
11
+ // return SECONDS as a string (setting in=10s reads back "10"), NOT ticks —
12
+ // the original raw-ticks interpretation shrank real values by 11 orders of
13
+ // magnitude. An UNSET point reads as Premiere's -400000 sentinel, reported
14
+ // here as null. Time-like objects (other builds) still go through
15
+ // timeValueToSeconds.
16
+ function ppb_pointValueToSeconds(value) {
17
+ if (value === null || typeof value === "undefined") {
18
+ return null;
19
+ }
20
+ if (typeof value === "object") {
21
+ return timeValueToSeconds(value);
22
+ }
23
+ var seconds = Number(value);
24
+ if (isNaN(seconds)) {
25
+ return null;
26
+ }
27
+ if (seconds <= -399999) {
28
+ // Premiere's "no in/out point set" sentinel
29
+ return null;
30
+ }
31
+ return seconds;
32
+ }
33
+
34
+ function ppb_getSequenceInOut(argsJson) {
35
+ try {
36
+ var args;
37
+ try {
38
+ args = JSON.parse(argsJson);
39
+ } catch (e) {
40
+ return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
41
+ }
42
+
43
+ if (!app.project) {
44
+ return JSON.stringify({ ok: false, error: "no project open" });
45
+ }
46
+
47
+ var seq = null;
48
+ if (args.sequenceName && typeof args.sequenceName === "string") {
49
+ seq = findSequenceByName(args.sequenceName);
50
+ if (!seq) {
51
+ return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
52
+ }
53
+ } else {
54
+ seq = app.project.activeSequence;
55
+ if (!seq) {
56
+ return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
57
+ }
58
+ }
59
+
60
+ var inSeconds = null;
61
+ var outSeconds = null;
62
+ try { inSeconds = ppb_pointValueToSeconds(seq.getInPoint()); } catch (e) { inSeconds = null; }
63
+ try { outSeconds = ppb_pointValueToSeconds(seq.getOutPoint()); } catch (e) { outSeconds = null; }
64
+
65
+ return JSON.stringify({
66
+ ok: true,
67
+ result: {
68
+ sequenceName: seq.name,
69
+ inSeconds: inSeconds,
70
+ outSeconds: outSeconds
71
+ }
72
+ });
73
+ } catch (e) {
74
+ return JSON.stringify({ ok: false, error: e.toString() });
75
+ }
76
+ }