# How to export a video programmatically with batchplay

**URL:** https://forums.creativeclouddeveloper.com/t/how-to-export-a-video-programmatically-with-batchplay/9701
**Category:** UXP Plugin API
**Tags:** uxp, javascript, batch-play
**Created:** [February 25, 2025, 4:39pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-export-a-video-programmatically-with-batchplay/9701 "2025-02-25T16:39:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Danilo01Cost](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Danilo01Cost](https://forums.creativeclouddeveloper.com/u/Danilo01Cost)
#### Post date: [February 25, 2025, 4:39pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-export-a-video-programmatically-with-batchplay/9701/1 "2025-02-25T16:39:39Z")

</div>

Hi all im working on a bulk video exporter and wanted to see if there is a way to export videos without the dialog popping up.

This is what I have to export the video so far but it always opens the dialog box and I have to manually click on render

```auto
  await core.executeAsModal(
        async () => {
          return await action.batchPlay(
            [
              {
                _obj: "export",
                // Optionally specify which doc to export:
                _target: [{ _ref: "document", _id: docId }],

                using: {
                  _obj: "videoExport",
                  directory: {
                    _path: folderToken,
                    _kind: "local",
                  },
                  // File name for the exported video:
                  name: "test Video.mp4",

                  ameFormatName: "H.264",
                  amePresetName: "1_High Quality.epr",
                  useDocumentSize: true,
                  useDocumentFrameRate: true,
                  // frameRate: 15,
                  pixelAspectRatio: {
                    _enum: "pixelAspectRatio",
                    _value: "document",
                  },
                  fieldOrder: {
                    _enum: "videoField",
                    _value: "preset",
                  },
                  manage: true,

                  // Example frames—adjust as needed:
                  inFrame: 0,
                  outFrame: 450,

                  renderAlpha: {
                    _enum: "alphaRendering",
                    _value: "none",
                  },
                  quality: 1,
                  Z3DPrefHighQualityErrorThreshold: 5,
                },
                _options: {
                  dialogOptions: "dontDisplay",
                },
              },
            ],
            { modalBehavior: "execute" }
          );
        },
        { commandName: "Action Commands" }
      );

```
