Skip to main content
Participant
October 8, 2013
Question

Error Using DialogModes.NO With ExecuteAction

  • October 8, 2013
  • 0 replies
  • 1193 views

Hello all,

I am trying to export an image sequence as an MP4 using File->Export->RenderVideo...

I was able to get the code using the script listener plugin.

Here is my javascript code:

Inputs

FilePath       = "C:\\tmp"

FileName     = "test.mp4"

Function

if (!Preview.prototype.RenderMp4)

{

  Preview.prototype.RenderMp4 = function (filePath, fileName)

          {

          try {

                    var idExpr = charIDToTypeID( "Expr" );

                    var desc3 = new ActionDescriptor();

                    var idUsng = charIDToTypeID( "Usng" );

                    var desc4 = new ActionDescriptor();

                    var iddirectory = stringIDToTypeID( "directory" );

                    desc4.putPath( iddirectory, new File( fileName ) );

                    var idNm = charIDToTypeID( "Nm  " );

                    desc4.putString( idNm, filePath );

                    var idameFormatName = stringIDToTypeID( "ameFormatName" );

                    desc4.putString( idameFormatName, """H.264""" );

                    var idamePresetName = stringIDToTypeID( "amePresetName" );

                    desc4.putString( idamePresetName, """1_High Quality.epr""" );

                    var iduseDocumentSize = stringIDToTypeID( "useDocumentSize" );

                    desc4.putBoolean( iduseDocumentSize, true );

                    var iduseDocumentFrameRate = stringIDToTypeID( "useDocumentFrameRate" );

                    desc4.putBoolean( iduseDocumentFrameRate, true );

                    var idpixelAspectRatio = stringIDToTypeID( "pixelAspectRatio" );

                    var idpixelAspectRatio = stringIDToTypeID( "pixelAspectRatio" );

                    var idDcmn = charIDToTypeID( "Dcmn" );

                    desc4.putEnumerated( idpixelAspectRatio, idpixelAspectRatio, idDcmn );

                    var idfieldOrder = stringIDToTypeID( "fieldOrder" );

                    var idvideoField = stringIDToTypeID( "videoField" );

                    var idpreset = stringIDToTypeID( "preset" );

                    desc4.putEnumerated( idfieldOrder, idvideoField, idpreset );

                    var idmanage = stringIDToTypeID( "manage" );

                    desc4.putBoolean( idmanage, true );

                    var idallFrames = stringIDToTypeID( "allFrames" );

                    desc4.putBoolean( idallFrames, true );

                    var idrenderAlpha = stringIDToTypeID( "renderAlpha" );

                    var idalphaRendering = stringIDToTypeID( "alphaRendering" );

                    var idNone = charIDToTypeID( "None" );

                    desc4.putEnumerated( idrenderAlpha, idalphaRendering, idNone );

                    var idQlty = charIDToTypeID( "Qlty" );

                    desc4.putInteger( idQlty, 1 );

                    var idvideoExport = stringIDToTypeID( "videoExport" );

                    desc3.putObject( idUsng, idvideoExport, desc4 );

                    executeAction( idExpr, desc3, DialogModes.NO);

                    } catch (e) {alert (e)}

          }

}

Error

Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.

- Could not complete the command because of a problem with Adobe Media Encoder.

Notes

The above function will work if we replace:

executeAction( idExpr, desc3, DialogModes.NO);

with

executeAction( idExpr, desc3, DialogModes.ALL);

However, I want to suppress all input.to the user for full automation.

I am using PhotoShop CS6 (64 bit)

Any help would be greatly appreciated.

Thanks,

A.

This topic has been closed for replies.