Skip to content

Commit ac3b986

Browse files
committed
Add FrontendScript
1 parent 741e21a commit ac3b986

File tree

2 files changed

+232
-76
lines changed

2 files changed

+232
-76
lines changed

docs/reference/reference.md renamed to docs/reference/FrontendScript.md

Lines changed: 230 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,33 @@
1-
# Scripting API Reference
2-
3-
## FrontendScriptObject
4-
5-
**Scripting methods to the frontend**
6-
7-
<a id="methods-4"></a>
8-
9-
### Methods
10-
11-
- `addCompToBatch(compPath: string, presetPath: string = "", outputPath: string = ""): boolean` : Adds the first comp of an After Effects project resp. the first sequence of a Premiere Pro project to the batch.
12-
- `compPath`: Path to e.g. an After Effects project or Premiere Pro project. The first comp resp. sequence will be used.
13-
- `presetPath`: Optional. If `presetPath` is empty, then the default preset will be applied.
14-
- `outputPath`: Optional. If `outputPath` is empty, then the output file name will be generated based on the comp path.
15-
- `addDLToBatch(projectPath: string, format: string, presetPath: string, guid: string, outputPath: string = ""): [EncoderWrapper object](./todo.md)` : Adds
16-
e.g. an After Effects comp or Premiere Pro sequence to the batch and returns an [EncoderWrapper](./todo.md) object.
17-
- `projectPath`: E.g. Premiere Pro or After Effects project path.
18-
- `format`: E.g. `"H.264"`
19-
- `presetPath`: Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied.
20-
- `guid`: The unique id of e.g. a Premiere Pro sequence or After Effects composition.
21-
- `outputPath`: Optional. If `outputPath` is empty, then the output file name will be generated based on the project path.
22-
- `addFileSequenceToBatch(containingFolder: string, imagePath: string, presetPath: string, outputPath: string = ""): boolean` : Adds an image sequence to the batch. The images will be sorted in alphabetical order.
23-
- `containingFolder`: The folder containing image files.
24-
- `imagePath`: All images from the containing folder with the same extension will be added to the output file.
25-
- `outputPath`: Optional. If `outputPath` is empty, then the output
26-
file name will be generated based on the containingFolder name
27-
- `addFileToBatch(filePath: string, format: string, presetPath: string, outputPath: string = ""): [EncoderWrapper object](./todo.md)` : Adds a file to the batch and returns an [EncoderWrapper](./todo.md) object.
28-
- `filePath`: File path of a media source.
29-
- `format`: E.g. `"H.264"`
30-
- `presetPath`: Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied.
31-
- `outputPath`: Optional. If `outputPath` is empty, then the output file name will be generated based on the file path.
32-
- `addItemToBatch(sourcePath: string): boolean` : Adds a media source to the batch.
33-
- `sourcePath`: Path of the media source.
34-
- `addTeamProjectsItemToBatch(projectsURL: string, format: string, presetPath: string, outputPath: string): [EncoderWrapper object](./todo.md)` : Adds a team project item to the batch and returns an [EncoderWrapper](./todo.md) object.
35-
- `projectsURL`: Team Projects URL or Team Projects Snap. You can
36-
create a tp2snap file in PPro for a ProjectItem via the scripting
37-
API saveProjectSnapshot.
38-
- `format`: E.g. `"H.264"`
39-
- `presetPath`: Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied.
40-
- `addXMLToBatch(xmlPath: string, presetPath: string, outputFolderPath: string = ""): boolean` : Adds
41-
Final Cut Pro xml to the batch.
42-
- `xmlPath`: Path to a Final Cut Pro xml file.
43-
- `outputFolderPath`: Optional. If outputFolderPath is empty, then the output file name will be generated based on the XML file path.
44-
- `getDLItemsAtRoot(projectPath: string): array of strings` : Returns the list of GUIDs for objects (sequences/comps) at the top/root level.
45-
- `projectPath`: E.g. Premiere Pro or After Effects project path.
46-
- `stitchFiles(mediaPaths: string, format: string, presetPath: string, outputPath: string): [EncoderWrapper object](./todo.md)` : Adds a batch item for the given media and returns an [EncoderWrapper](./todo.md) object.
47-
- `mediaPaths`: Semicolon delimited list of media paths.
48-
- `format`: E.g. `"H.264"`
49-
- `presetPath`: Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied.
50-
- `stopBatch(): boolean` : Stops the batch.
51-
52-
<a id="code-samples-9"></a>
53-
54-
### Examples
55-
56-
<details>
57-
58-
<summary>addCompToBatch Example (click to expand):</summary>
1+
# FrontendScriptObject
2+
3+
Scripting methods for the frontend.
4+
5+
---
6+
7+
## Methods
8+
9+
### FrontendScript.addCompToBatch()
10+
11+
`app.getFrontend().addCompToBatch(compPath, [presetPath], [outputPath])`
12+
13+
#### Description
14+
15+
Adds the first comp of an After Effects project resp. the first sequence of a Premiere Pro project to the batch.
16+
17+
#### Parameters
18+
19+
| Parameter | Type | Description |
20+
| ------------ | ------ | ---------------------------------------------------------------------------------------------------------- |
21+
| `compPath` | String | Path to e.g. an After Effects project or Premiere Pro project. The first comp resp. sequence will be used. |
22+
| `presetPath` | String | Optional. If `presetPath` is empty, then the default preset will be applied. |
23+
| `outputPath` | String | Optional. If `outputPath` is empty, then the output file name will be generated based on the comp path. |
24+
25+
#### Returns
26+
27+
Boolean
28+
29+
#### Example
30+
5931
```javascript
6032
var projectPath = "C:\\testdata\\aeCompTest.aep";
6133
var preset = "C:\\testdata\\HighQuality720HD.epr";
@@ -106,9 +78,33 @@ if (frontend) {
10678
}
10779
```
10880

109-
</details><br><details>
11081

111-
<summary>addDLToBatch Example (click to expand):</summary>
82+
---
83+
84+
### FrontendScript.addDLToBatch()
85+
86+
`app.getFrontend().addDLToBatch(projectPath, format, presetPath, guid, [outputPath])`
87+
88+
#### Description
89+
90+
Adds e.g. an After Effects comp or Premiere Pro sequence to the batch and returns an [EncoderWrapper](./todo.md).
91+
92+
#### Parameters
93+
94+
| Parameter | Type | Description |
95+
| ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
96+
| `projectPath` | String | E.g. Premiere Pro or After Effects project path. |
97+
| `format` | String | E.g. `"H.264"` |
98+
| `presetPath` | String | Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied. |
99+
| `guid` | String | The unique id of e.g. a Premiere Pro sequence or After Effects composition. |
100+
| `outputPath` | String | Optional. If `outputPath` is empty, then the output file name will be generated based on the project path. |
101+
102+
#### Returns
103+
104+
[EncoderWrapper object](./todo.md)
105+
106+
#### Example
107+
112108
```javascript
113109
// The projectPath can be a path to an AfterEffects, Premiere Pro or Character Animator project
114110
var format = "H.264";
@@ -181,9 +177,31 @@ if (frontend) {
181177
}
182178
```
183179

184-
</details><br><details>
180+
---
181+
182+
### FrontendScript.addFileSequenceToBatch()
183+
184+
`app.getFrontend().addFileSequenceToBatch(containingFolder, imagePath, presetPath, [outputPath])`
185+
186+
#### Description
187+
188+
Adds an image sequence to the batch. The images will be sorted in alphabetical order.
189+
190+
#### Parameters
191+
192+
| Parameter | Type | Description |
193+
| ------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
194+
| `containingFolder` | String | The folder containing image files. |
195+
| `imagePath` | String | All images from the containing folder with the same extension will be added to the output file. |
196+
| `presetPath` | String | Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied. |
197+
| `outputPath` | String | Optional. If `outputPath` is empty, then the output file name will be generated based on the containingFolder name. |
198+
199+
#### Returns
200+
201+
Boolean
202+
203+
#### Example
185204

186-
<summary>addFileSequenceToBatch Example (click to expand):</summary>
187205
```javascript
188206
var firstFile = "C:\\testdata\\Images\\AB-1.jpg";
189207
var preset = "C:\\testdata\\HighQuality720HD.epr";
@@ -234,9 +252,31 @@ if (frontend) {
234252
}
235253
```
236254

237-
</details><br><details>
255+
---
256+
257+
### FrontendScript.addFileToBatch()
258+
259+
`app.getFrontend().addFileToBatch(filePath, format, presetPath, [outputPath])`
260+
261+
#### Description
262+
263+
Adds a file to the batch and returns an [EncoderWrapper](./todo.md).
264+
265+
#### Parameters
266+
267+
| Parameter | Type | Description |
268+
| ------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
269+
| `filePath` | String | File path of a media source. |
270+
| `format` | String | E.g. `"H.264"` |
271+
| `presetPath` | String | Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied. |
272+
| `outputPath` | String | Optional. If `outputPath` is empty, then the output file name will be generated based on the file path. |
273+
274+
#### Returns
275+
276+
[EncoderWrapper object](./todo.md)
277+
278+
#### Example
238279

239-
<summary>addFileToBatch Example (click to expand):</summary>
240280
```javascript
241281
var source = "C:\\testdata\\testmedia3.mxf";
242282
var preset = "C:\\testdata\\HighQuality720HD.epr";
@@ -295,9 +335,28 @@ if (frontend) {
295335
}
296336
```
297337

298-
</details><br><details>
338+
---
339+
340+
### FrontendScript.addItemToBatch()
341+
342+
`app.getFrontend().addItemToBatch(sourcePath)`
343+
344+
#### Description
345+
346+
Adds a media source to the batch.
347+
348+
#### Parameters
349+
350+
| Parameter | Type | Description |
351+
| ------------ | ------ | ------------------------- |
352+
| `sourcePath` | String | Path of the media source. |
353+
354+
#### Returns
355+
356+
Boolean
357+
358+
#### Example
299359

300-
<summary>addItemToBatch Example (click to expand):</summary>
301360
```javascript
302361
var source = "C:\\testdata\\testmedia3.mxf";
303362

@@ -336,9 +395,31 @@ if (frontend) {
336395
}
337396
```
338397

339-
</details><br><details>
398+
---
399+
400+
### FrontendScript.addTeamProjectsItemToBatch()
401+
402+
`app.getFrontend().addTeamProjectsItemToBatch(projectsURL, format, presetPath, [outputPath])`
403+
404+
#### Description
405+
406+
Adds a team project item to the batch and returns an [EncoderWrapper](./todo.md).
407+
408+
#### Parameters
409+
410+
| Parameter | Type | Description |
411+
| ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
412+
| `projectsURL` | String | Team Projects URL or Team Projects Snap. You can create a tp2snap file in PPro for a ProjectItem via the scripting API saveProjectSnapshot. |
413+
| `format` | String | E.g. `"H.264"` |
414+
| `presetPath` | String | Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied. |
415+
| `outputPath` | String | Optional. If `outputPath` is empty, then the output file name will be generated based on the comp path. |
416+
417+
#### Returns
418+
419+
[EncoderWrapper object](./todo.md)
420+
421+
#### Example
340422

341-
<summary>addTeamProjectsItemToBatch Example (click to expand):</summary>
342423
```javascript
343424
// use for the source (projectsURL) a valid Team Projects URL or a Team Projects Snap
344425
// you can create a tp2snap file in PPro for a ProjectItem via the scripting API saveProjectSnapshot
@@ -404,9 +485,29 @@ if (frontend) {
404485
}
405486
```
406487

407-
</details><br><details>
488+
---
489+
490+
### FrontendScript.addXMLToBatch()
491+
492+
`app.getFrontend().addXMLToBatch(xmlPath, presetPath, [outputFolderPath])`
493+
494+
#### Description
495+
496+
Adds Final Cut Pro xml to the batch.
497+
498+
#### Parameters
499+
500+
| Parameter | Type | Description |
501+
| ------------------ | ------ | ----------------------------------------------------------------------------------------------------------------- |
502+
| `xmlPath` | String | Path to a Final Cut Pro xml file. |
503+
| `outputFolderPath` | String | Optional. If `outputFolderPath` is empty, then the output file name will be generated based on the XML file path. |
504+
505+
#### Returns
506+
507+
Boolean
508+
509+
#### Example
408510

409-
<summary>addXMLToBatch Example (click to expand):</summary>
410511
```javascript
411512
var source = "C:\\testdata\\FCP-3.xml"; // Final Cut Pro xml file
412513
var preset = "C:\\testdata\\HighQuality720HD.epr";
@@ -447,9 +548,28 @@ if (frontend) {
447548
}
448549
```
449550

450-
</details><br><details>
551+
---
552+
553+
### FrontendScript.getDLItemsAtRoot()
554+
555+
`app.getFrontend().getDLItemsAtRoot(projectPath)`
556+
557+
#### Description
558+
559+
Returns the list of GUIDs for objects (sequences/comps) at the top/root level.
560+
561+
#### Parameters
562+
563+
| Parameter | Type | Description |
564+
| ------------- | ------ | ------------------------------------------------ |
565+
| `projectPath` | String | E.g. Premiere Pro or After Effects project path. |
566+
567+
#### Returns
568+
569+
Array of strings
570+
571+
#### Example
451572

452-
<summary>getDLItemsAtRoot Example (click to expand):</summary>
453573
```javascript
454574
var projectPath = "C:\\testdata\\aeCompTest.aep"; // project path
455575

@@ -471,9 +591,31 @@ if (frontend) {
471591
}
472592
```
473593

474-
</details><br><details>
594+
---
595+
596+
### FrontendScript.stitchFiles()
597+
598+
`app.getFrontend().stitchFiles(mediaPaths, format, presetPath, [outputPath])`
599+
600+
#### Description
601+
602+
Adds a batch item for the given media and returns an [EncoderWrapper](./todo.md).
603+
604+
#### Parameters
605+
606+
| Parameter | Type | Description |
607+
| ------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
608+
| `mediaPaths` | String | Semicolon delimited list of media paths. |
609+
| `format` | String | E.g. `"H.264"` |
610+
| `presetPath` | String | Either a preset or a format input must be present. If no preset is used then the default preset of the specified format will be applied. |
611+
| `outputPath` | String | Optional. If `outputPath` is empty, then the output file name will be generated based on the comp path. |
612+
613+
#### Returns
614+
615+
[EncoderWrapper object](./todo.md)
616+
617+
#### Example
475618

476-
<summary>stitchFiles Example (click to expand):</summary>
477619
```javascript
478620
var format = "H.264";
479621
var media_1 = "C:\\testdata\\testmedia.mp4";
@@ -534,3 +676,17 @@ if (frontend) {
534676
$.writeln("frontend not valid");
535677
}
536678
```
679+
680+
---
681+
682+
### FrontendScript.stopBatch()
683+
684+
`app.getFrontend().stopBatch()`
685+
686+
#### Description
687+
688+
Stops the batch.
689+
690+
#### Returns
691+
692+
Boolean

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ nav:
2121
- Reference:
2222
- Application Object: reference/Application.md
2323
- EncoderHostScript Object: reference/EncoderHostScript.md
24-
- ExporterScript Object: reference/ExporterScript.md
2524
- EncoderWrapper Object: reference/EncoderWrapper.md
25+
- ExporterScript Object: reference/ExporterScript.md
26+
- FrontendScript Object: reference/FrontendScript.md
2627
- SourceMediaInfo Object: reference/SourceMediaInfo.md
2728
- WatchFolderScript Object: reference/WatchFolderScript.md
28-
- _todo: reference/reference.md
2929

3030

3131
# Do not touch below-- shared for all docs

0 commit comments

Comments
 (0)