skip to Main Content

I’m using Photoshop CC v20.0.7, and I’m trying to record the [file > export > "export as"] as an action. When I hit "record" and try, nothing is recorded in my action sequence, even though the jpg is correctly saved in my folder. Other methods of exporting and saving jpg/png won’t work for me as I’m using a duotone document with only 2 pantone spot colors channels. Is there a way to export/save my duotone document into a picture (for preview purposes) AND have it recorded as an action/script?

PS: The "quick export as jpg" is recorded in the actions, but has no effect when I run the script, so it doesn’t seem a viable option.

Thank you!

2

Answers


  1. If you use the scripting listener plugin, that’ll record menu actions that aren’t typically recorded by the action recorder tool, although the output isn’t easily readable.

    Alternatively, you can do something like this:

    saveAsJPG();
    function saveAsJPG() {
        var doc = app.activeDocument;
        var tempDoc = documents.add(doc.width,doc.height,doc.resolution,doc.name);
        var docPath = documents[0].fullName
        placeImage(docPath);
        saveFile = new File("d:/"+documents[0].name.replace(/[.]...$/,""));
        saveOptions = new JPEGSaveOptions();
        saveOptions.embedColorProfile = true;
        saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
        saveOptions.matte = MatteType.NONE;
        saveOptions.quality = 10; 
        activeDocument.saveAs(saveFile, saveOptions, true, Extension.LOWERCASE);
        activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    }
    function placeImage(imagePath) {
        var idPlc = charIDToTypeID( "Plc " ); 
        var desc11 = new ActionDescriptor();  
        var idnull = charIDToTypeID( "null" );
        desc11.putPath( idnull, new File(imagePath) );
        var idFTcs = charIDToTypeID( "FTcs" ); 
        var idQCSt = charIDToTypeID( "QCSt" );   
        var idQcsa = charIDToTypeID( "Qcsa" ); 
        desc11.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );     
        var desc12 = new ActionDescriptor();     
        var idHrzn = charIDToTypeID( "Hrzn" );    
        var idPxl = charIDToTypeID( "#Pxl" );      
        desc12.putUnitDouble( idHrzn, idPxl, 0.000000 );     
        var idVrtc = charIDToTypeID( "Vrtc" );    
        var idPxl = charIDToTypeID( "#Pxl" );    
        desc12.putUnitDouble( idVrtc, idPxl, 0.000000 );
        var idOfst = charIDToTypeID( "Ofst" );
        desc11.putObject( idOfst, idOfst, desc12 );
        executeAction( idPlc, desc11, DialogModes.NO );
    }
    
    Login or Signup to reply.
  2. The solution is to use Save As -> Jpeg. You get all the same options and they all record into the action.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search