1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "plan": {
12 "title": "My first auto edit",
13 "width": 1080,
14 "height": 1920,
15 "fps": 30,
16 "media": [
17 {
18 "file": "shot1.png",
19 "duration": 4
20 },
21 {
22 "file": "shot2.png",
23 "duration": 4
24 }
25 ],
26 "script": [
27 {
28 "text": "Welcome to our shop!",
29 "seconds": 4
30 },
31 {
32 "text": "New items every day",
33 "seconds": 4
34 }
35 ],
36 "decos": [
37 {
38 "start": 0,
39 "end": 4,
40 "text": "SALE",
41 "style": "gold",
42 "y": 30
43 }
44 ]
45 }
46};
47
48
49const run = await client.actor("kotaro-project/fcpxml-auto-edit").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59