6 Replies Latest reply on Apr 15, 2016 1:31 AM by DBLjan

    Deleting unused swatches change the gradient

    Muthuraj Durairaj Level 1

      Hi All,

       

      I have tried this Javascript to remove unused swatches in a document (Indesign CS4). It did remove all the unused swatches but it changed the used gradient color into black color and still has the gradient property but couldn't change any color values for that particular gradient after running the script.

       

       

      #target indesign
      var myIndesignDoc = app.activeDocument;
      var myUnusedSwatches = myIndesignDoc.unusedSwatches;
      for (var j=myIndesignDoc.unusedSwatches.length; j > 0; j--)
        myIndesignDoc.unusedSwatches[j-1].remove();
      

       

       

      Please advise me where I did wrong and also please suggest the right solution for this.