1 Reply Latest reply: Dec 17, 2011 9:48 AM by Muppet Mark RSS

    [JS][CS4] Add effect to Pageitem

    booyajamo Community Member

      I'd like to add a simple drop shadow to a page item. In looking through the object model it I can't seem to find a way to do it. Is this impossible?

       

      I thought I'd try just applying an existing graphic style but that doens't seem to be working either. Can anyone help me either add a drop shadow or simply apply one of the default graphic styles from illustrator?  There is one called "Drop Shadow Hard" under "Image Effects" in the graphic styles panel. Any ideas?

       

      var doc = app.activeDocument;
      var shadowLayer = doc.layers.add();
      var shadowRec = shadowLayer.pathItems.rectangle(-20, -10, 650, -820);
      
      var dropShadow = doc.graphicStyles.getByName("Drop Shadow Hard");
      dropShadow.applyTo(shadowRec);
      

       

      Thanks,

      Lindsay