Skip to main content
Simone Pompei
Inspiring
January 23, 2015
Question

how can i create a script to change printer settings?

  • January 23, 2015
  • 1 reply
  • 644 views

i need to create a script to ask me 9 times to change the kind of paper and every time automatically change the icc profile of the paper.

Is it possiple with script?

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
January 24, 2015

Have you tried recoding with ScriptingListener.plugin?

If that does not provide the relevant code then I suspect the issue would have to be addressed on the OS side.

Simone Pompei
Inspiring
January 24, 2015

i don't really understand what does this  plugin...

I see the Extend Script Toolkit to make javascript action...but i would like to know if the action could set even the proprietary settings of the printer.

JJMack
Community Expert
Community Expert
January 24, 2015

Install the Plug-in then open Photoshop do a print from Photoshop setting all the Photoshop and Printer setting using the controls in the Photoshop Print dialog. See what the Scriptlistener Plug-in records in your system configuration. It may record only the Photoshop settings it may also set printer driver setting.  I don't know.  Even on I my system I do not know what the long string of recorded numbers are. They may be for the device in my environment my printer is on the network.  Here is what I see recorded.  A Script could change some settings however I would not know how to change the string of numbers recorded.

// =======================================================

var idPrnt = charIDToTypeID( "Prnt" );

    var desc45 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref26 = new ActionReference();

        var idPrpr = charIDToTypeID( "Prpr" );

        var idprintOutput = stringIDToTypeID( "printOutput" );

        ref26.putProperty( idPrpr, idprintOutput );

        var idDcmn = charIDToTypeID( "Dcmn" );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref26.putEnumerated( idDcmn, idOrdn, idTrgt );

    desc45.putReference( idnull, ref26 );

    var idprintOutput = stringIDToTypeID( "printOutput" );

        var desc46 = new ActionDescriptor();

        var idClrS = charIDToTypeID( "ClrS" );

        var idClrS = charIDToTypeID( "ClrS" );

        var idRGBC = charIDToTypeID( "RGBC" );

        desc46.putEnumerated( idClrS, idClrS, idRGBC );

        var idNm = charIDToTypeID( "Nm  " );

        desc46.putString( idNm, """Pro4800 PLPP260""" );

        var idInte = charIDToTypeID( "Inte" );

        var idInte = charIDToTypeID( "Inte" );

        var idClrm = charIDToTypeID( "Clrm" );

        desc46.putEnumerated( idInte, idInte, idClrm );

        var idMpBl = charIDToTypeID( "MpBl" );

        desc46.putBoolean( idMpBl, true );

        var idprintSixteenBit = stringIDToTypeID( "printSixteenBit" );

        desc46.putBoolean( idprintSixteenBit, false );

        var idprinterName = stringIDToTypeID( "printerName" );

        desc46.putString( idprinterName, """\\XPS9100\EPSON Stylus Pro 4800""" );

        var idprintProofSetup = stringIDToTypeID( "printProofSetup" );

            var desc47 = new ActionDescriptor();

            var idBltn = charIDToTypeID( "Bltn" );

            var idbuiltinProof = stringIDToTypeID( "builtinProof" );

            var idproofCMYK = stringIDToTypeID( "proofCMYK" );

            desc47.putEnumerated( idBltn, idbuiltinProof, idproofCMYK );

        var idproofSetup = stringIDToTypeID( "proofSetup" );

        desc46.putObject( idprintProofSetup, idproofSetup, desc47 );

    var idprintOutput = stringIDToTypeID( "printOutput" );

    desc45.putObject( idprintOutput, idprintOutput, desc46 );

    var idprintViewProofSetup = stringIDToTypeID( "printViewProofSetup" );

        var desc48 = new ActionDescriptor();

        var idBltn = charIDToTypeID( "Bltn" );

        var idbuiltinProof = stringIDToTypeID( "builtinProof" );

        var idproofCMYK = stringIDToTypeID( "proofCMYK" );

        desc48.putEnumerated( idBltn, idbuiltinProof, idproofCMYK );

    var idproofSetup = stringIDToTypeID( "proofSetup" );

    desc45.putObject( idprintViewProofSetup, idproofSetup, desc48 );

    var idprintOutputOptions = stringIDToTypeID( "printOutputOptions" );

        var desc49 = new ActionDescriptor();

        var idCptn = charIDToTypeID( "Cptn" );

        desc49.putBoolean( idCptn, false );

        var idClbr = charIDToTypeID( "Clbr" );

        desc49.putBoolean( idClbr, false );

        var idRgsM = charIDToTypeID( "RgsM" );

        desc49.putBoolean( idRgsM, false );

        var idCrnC = charIDToTypeID( "CrnC" );

        desc49.putBoolean( idCrnC, false );

        var idCntC = charIDToTypeID( "CntC" );

        desc49.putBoolean( idCntC, false );

        var idLbls = charIDToTypeID( "Lbls" );

        desc49.putBoolean( idLbls, false );

        var idNgtv = charIDToTypeID( "Ngtv" );

        desc49.putBoolean( idNgtv, false );

        var idEmlD = charIDToTypeID( "EmlD" );

        desc49.putBoolean( idEmlD, false );

        var idIntr = charIDToTypeID( "Intr" );

        desc49.putBoolean( idIntr, false );

        var idBckg = charIDToTypeID( "Bckg" );

            var desc50 = new ActionDescriptor();

            var idRd = charIDToTypeID( "Rd  " );

            desc50.putDouble( idRd, 255.000000 );

            var idGrn = charIDToTypeID( "Grn " );

            desc50.putDouble( idGrn, 255.000000 );

            var idBl = charIDToTypeID( "Bl  " );

            desc50.putDouble( idBl, 255.000000 );

        var idRGBC = charIDToTypeID( "RGBC" );

        desc49.putObject( idBckg, idRGBC, desc50 );

        var idBrdT = charIDToTypeID( "BrdT" );

        var idRlt = charIDToTypeID( "#Rlt" );

        desc49.putUnitDouble( idBrdT, idRlt, 0.000000 );

        var idBld = charIDToTypeID( "Bld " );

        var idRlt = charIDToTypeID( "#Rlt" );

        desc49.putUnitDouble( idBld, idRlt, 0.000000 );

        var idRslt = charIDToTypeID( "Rslt" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc49.putUnitDouble( idRslt, idPxl, 100.000000 );

        var idvectorData = stringIDToTypeID( "vectorData" );

        desc49.putBoolean( idvectorData, true );

        var idPgPs = charIDToTypeID( "PgPs" );

        var idPgPs = charIDToTypeID( "PgPs" );

        var idStrF = charIDToTypeID( "StrF" );

        desc49.putEnumerated( idPgPs, idPgPs, idStrF );

        var idLeft = charIDToTypeID( "Left" );

        var idRlt = charIDToTypeID( "#Rlt" );

        desc49.putUnitDouble( idLeft, idRlt, 0.000000 );

        var idTop = charIDToTypeID( "Top " );

        var idRlt = charIDToTypeID( "#Rlt" );

        desc49.putUnitDouble( idTop, idRlt, 139.592092 );

        var idScl = charIDToTypeID( "Scl " );

        var idPrc = charIDToTypeID( "#Prc" );

        desc49.putUnitDouble( idScl, idPrc, 88.305006 );

        var idcropWhenPrinting = stringIDToTypeID( "cropWhenPrinting" );

        desc49.putBoolean( idcropWhenPrinting, false );

        var idcropRectBottom = stringIDToTypeID( "cropRectBottom" );

        desc49.putInteger( idcropRectBottom, 652 );

        var idcropRectLeft = stringIDToTypeID( "cropRectLeft" );

        desc49.putInteger( idcropRectLeft, 0 );

        var idcropRectRight = stringIDToTypeID( "cropRectRight" );

        desc49.putInteger( idcropRectRight, 611 );

        var idcropRectTop = stringIDToTypeID( "cropRectTop" );

        desc49.putInteger( idcropRectTop, 139 );

    var idprintOutputOptions = stringIDToTypeID( "printOutputOptions" );

    desc45.putObject( idprintOutputOptions, idprintOutputOptions, desc49 );

    var idosSpecificPrintInfo = stringIDToTypeID( "osSpecificPrintInfo" );

        var desc51 = new ActionDescriptor();

        var idSstI = charIDToTypeID( "SstI" );

        desc51.putData( idSstI, String.fromCharCode( 2, 0, 0, 0, 32, 110, 105, 87, 0, 0, 0, 0, 92, 0, 92, 0, 88, 0, 80, 0, 83, 0, 57, 0, 49, 0, 48, 0, 48, 0, 92, 0,

69, 0, 80, 0, 83, 0, 79, 0, 78, 0, 32, 0, 83, 0, 116, 0, 121, 0, 108, 0, 117, 0, 115, 0, 32, 0, 80, 0, 114, 0, 111, 0,

32, 0, 52, 0, 56, 0, 48, 0, 0, 0, 0, 0, 1, 4, 0, 16, 220, 0, 108, 5, 15, 155, 128, 7, 1, 0, 1, 0, 234, 10, 111, 8,

100, 0, 1, 0, 2, 1, 104, 1, 2, 0, 1, 0, 104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 50, 117, 0, 0,

1, 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) );

    var idosSpecificPrintInfo = stringIDToTypeID( "osSpecificPrintInfo" );

    desc45.putObject( idosSpecificPrintInfo, idosSpecificPrintInfo, desc51 );

    var idCptn = charIDToTypeID( "Cptn" );

    desc45.putString( idCptn, """""" );

executeAction( idPrnt, desc45, DialogModes.NO );

// =======================================================

var idprintOneCopy = stringIDToTypeID( "printOneCopy" );

executeAction( idprintOneCopy, undefined, DialogModes.NO );

JJMack