0 Replies Latest reply on Apr 8, 2014 8:15 AM by Unique

    Accessing photoshop from indesign

    Unique

      Hi forum,

       

       

      First time for me;

       

      I'm trying to export psd file as "ExportType.SAVEFORWEB, opts" from Indesign, through GUI, that worked.

       

      Just by clicking the button....

       

      But im trying to change the value of Dither in Photoshop "Save for Web options" in indesign through GUI, it doesn't work.

       

      Could anybody help to change the value of Dither from indesign.

       

       

       

      #targetengine: Session

       

      dialog();

       

       

       

      function dialog() {

       

      var myDialog = new Window('palette', 'CHANGEfrom_Indesign');

      myDialog.graphics.backgroundColor = myDialog.graphics.newBrush (myDialog.graphics.BrushType.SOLID_COLOR, [0.5, 0.5, 0.1]);

      var myGroup = myDialog.add('group', undefined, '');

      var myGroup1 = myDialog.add('group', undefined, '');

      myGroup1.orientation = "column"

       

       

       

       

      var myGroup2 = myDialog.add('panel', undefined, '');

      var per = myGroup2.add("statictext", undefined, "Enter Dither Value");

       

      per.graphics.foregroundColor = per.graphics.newPen (per.graphics.PenType.SOLID_COLOR, [0.7, 0.7, 0.7], 0.7);

      var myText = myGroup2.add("edittext", undefined, "");

      myText.graphics.font = ScriptUI.newFont ("Helvetica", "Bold", 15);

      myText.graphics.foregroundColor = myText.graphics.newPen (myText.graphics.PenType.SOLID_COLOR, [1, 0, 0], 1);

      myText.characters = 5;

      myText.active = "true";

       

       

       

      var myGroup9 = myDialog.add('panel', undefined, '');

      var newButton10 = myGroup9.add('button', undefined, 'CHECK_PHOTOSHOP', {name:'Button'});

      newButton10.minimumSize.width = 280;

       

       

       

       

       

       

       

       

      myDialog.show();

       

       

       

       

       

      newButton10.onClick= function () {

      ready();

       

      }

       

       

       

       

       

      }

       

       

       

       

       

       

      function ready() {

          var resultN = BridgeTalkMessage();

          }

       

          function BridgeTalkMessage() {

       

              var bt1 = new BridgeTalk();

              var re1;

              bt1.target = "photoshop";

       

              bt1.body = openFile.toString() + "\ropenFile()";     

               bt1.onResult = function(e) {

                re1= e.body;

              }    

              bt1.send(900);

               return bt1.send;

                 

      }

       

       

       

       

       

       

      function openFile() {

       

       

       

      currentDoc = app.activeDocument;

       

       

      var pngDestination = "/Users/task/Desktop/TEST_FLASH/Animations/";

       

       

      var fileName = currentDoc.name;

      fileName = fileName.substr(0,fileName.length-4);   

         

      var opts = new ExportOptionsSaveForWeb();

      opts.format = SaveDocumentType.COMPUSERVEGIF;

       

      opts.colorReduction = ColorReductionType.PERCEPTUAL;

      opts.dither = Dither.DIFFUSION;

      opts.transparency = true;

      opts.quality = 100;

      opts.ditherAmount = 100;

      opts.includeProfile = true;

      opts.matteColor = new RGBColor();

      opts.matteColor.red = 255;

      opts.matteColor.green = 255;

      opts.matteColor.blue = 255;

       

       

      currentDoc.exportDocument (File(pngDestination + fileName), ExportType.SAVEFORWEB, opts);

       

       

      }

       

       

      Please support on this....