Skip to content

Commit d403494

Browse files
committed
Consolidate FrontendScript object events
1 parent 960819b commit d403494

File tree

3 files changed

+74
-74
lines changed

3 files changed

+74
-74
lines changed

docs/events/BatchItemCreationFailedEvent.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

docs/events/ItemAddedToBatchEvent.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/reference/FrontendScript.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,77 @@ Stops the batch.
689689
#### Returns
690690

691691
Boolean
692+
693+
---
694+
695+
## Events
696+
697+
### onBatchItemCreationFailed
698+
699+
`app.getFrontend().addEventListener("onBatchItemCreationFailed")`
700+
701+
The event will be sent after batch item creation failed.
702+
703+
Can be used for the following [FrontendScript Object](#frontendscriptobject) APIs:
704+
705+
- [FrontendScript.addFileToBatch()](#frontendscriptaddfiletobatch)
706+
- [FrontendScript.addTeamProjectsItemToBatch()](#frontendscriptaddteamprojectsitemtobatch)
707+
- [FrontendScript.addDLToBatch()](#frontendscriptadddltobatch)
708+
709+
#### Properties
710+
711+
| Property | Type | Description |
712+
| ------------- | ------ | -------------------- |
713+
| `error` | String | The error string |
714+
| `srcFilePath` | String | The source file path |
715+
716+
#### Example
717+
718+
```javascript
719+
var source = "C:\\testdata\\testmedia.mp4";
720+
721+
// sources for mac
722+
// var source = "/Users/Shared/testdata/testmedia.mp4"
723+
724+
var frontend = app.getFrontend();
725+
if (frontend) {
726+
frontend.addEventListener("onBatchItemCreationFailed", function (eventObj) {
727+
$.writeln("Sourcefile", eventObj.srcFilePath);
728+
$.writeln("onBatchItemCreationFailed: error", eventObj.error);
729+
});
730+
731+
var batchItemSuccess = frontend.addItemToBatch(source);
732+
if (batchItemSuccess) {
733+
$.writeln(source, " has been added successfully");
734+
}
735+
}
736+
```
737+
738+
### onItemAddedToBatch
739+
740+
`app.getFrontend().addEventListener("onItemAddedToBatch")`
741+
742+
The event will be sent after a batch item has been created successfully.
743+
744+
Can be used for all [FrontendScript Object](#frontendscriptobject) APIs which creates a batch item.
745+
746+
#### Example
747+
748+
```javascript
749+
var source = "C:\\testdata\\testmedia.mp4";
750+
751+
// //sources for mac
752+
// var source = "/Users/Shared/testdata/testmedia.mp4"
753+
754+
var frontend = app.getFrontend();
755+
if (frontend) {
756+
frontend.addEventListener("onItemAddedToBatch", function (eventObj) {
757+
$.writeln("Item added to Batch");
758+
});
759+
760+
var batchItemSuccess = frontend.addItemToBatch(source);
761+
if (batchItemSuccess) {
762+
$.writeln(source, " has been added successfully");
763+
}
764+
}
765+
```

0 commit comments

Comments
 (0)