Skip to main content
Known Participant
January 22, 2024
Answered

Resize script error

  • January 22, 2024
  • 1 reply
  • 922 views

PS version 25.3.1

Mac version 12.3

 

Getting "General Photoshop error.." error for Save action. PFA screenshot

 

Please suggest 

This topic has been closed for replies.
Correct answer c.pfaffenbichler

I have to resize images with specific sizes and the data is saved in a textfile.

The script is not working with below version

PS version 25.3.1

Mac version 12.3

 

Script works fine in below version

PS version 25.3.1

Mac version 12.6.5

 

Is there any alternative for save action ?


If you just need to save you could use the DOM-code. 

app.activeDocument.save();

1 reply

Stephen Marsh
Community Expert
Community Expert
January 22, 2024

Please provide the full script code using the </> forum toolbar button.

Known Participant
January 23, 2024
var idopen = stringIDToTypeID( "open" );
      var desc237 = new ActionDescriptor();
      var iddontRecord = stringIDToTypeID( "dontRecord" );
      desc237.putBoolean( iddontRecord, false );
      var idforceNotify = stringIDToTypeID( "forceNotify" );
      desc237.putBoolean( idforceNotify, true );
      var idnull = stringIDToTypeID( "null" );
      desc237.putPath( idnull, new File('/'+fp) );
      var iddocumentID = stringIDToTypeID( "documentID" );
      desc237.putInteger( iddocumentID, i );
      var idtemplate = stringIDToTypeID( "template" );
      desc237.putBoolean( idtemplate, false );
      executeAction( idopen, desc237, DialogModes.NO );

      var idimageSize = stringIDToTypeID( "imageSize" );
      var desc736 = new ActionDescriptor();
      var idwidth = stringIDToTypeID( "width" );
      var iddistanceUnit = stringIDToTypeID( "distanceUnit" );
      desc736.putUnitDouble( idwidth, iddistanceUnit, 200);
      var idscaleStyles = stringIDToTypeID( "scaleStyles" );
      desc736.putBoolean( idscaleStyles, true );
      var idconstrainProportions = stringIDToTypeID( "constrainProportions" );
      desc736.putBoolean( idconstrainProportions, true );
      var idinterfaceIconFrameDimmed = stringIDToTypeID( "interfaceIconFrameDimmed" );
      var idinterpolationType = stringIDToTypeID( "interpolationType" );
      var idautomaticInterpolation = stringIDToTypeID( "automaticInterpolation" );
      desc736.putEnumerated( idinterfaceIconFrameDimmed, idinterpolationType, idautomaticInterpolation );
     executeAction( idimageSize, desc736, DialogModes.NO );

     var idsave = stringIDToTypeID( "save" );
     var desc894 = new ActionDescriptor();
     var idin = stringIDToTypeID( "in" );
     desc894.putPath( idin, new File( app.activeDocument.fullName ) );
     var idsaveStage = stringIDToTypeID( "saveStage" );
     var idsaveStageType = stringIDToTypeID( "saveStageType" );
     var idsaveBegin = stringIDToTypeID( "saveBegin" );
     desc894.putEnumerated( idsaveStage, idsaveStageType, idsaveBegin );
     var iddocumentID = stringIDToTypeID( "documentID" );
     desc894.putInteger( iddocumentID, i);
 executeAction( idsave, desc894, DialogModes.NO );
c.pfaffenbichler
Community Expert
Community Expert
January 23, 2024

Is that the whole Script? 

The alert seems to refer to line 92.