0 Replies Latest reply on Mar 22, 2008 11:16 AM by (Gerald_Singelmann)

    Changing clipping paths

    Level 1
      Hello all,

      I have an idea for a script that bases on modifying the clipping path of an image. Basically what I try to achieve is that the image is visible only inside a selected path with some offset.

      Given a document with one polygon and one image with applied clipping path I would expect this to work:

      var aDoc = app.documents[0];
      var aGrap = aDoc.allGraphics[0];
      var aPol = aDoc.polygons[0];

      var ePath = aPol.paths[0];
      var aClip = aGrap.clippingPath;

      ePath = aPol.paths[0].entirePath;
      aClip.paths[0].entirePath = ePath;
      aClip.insetFrame = -2;
      ePath = aClip.paths[0].entirePath;
      aPol.paths[0].entirePath = ePath;

      But these lines

      aClip.paths[0].entirePath = ePath;
      aClip.insetFrame = -2;

      seem to exclude each other. The insetFrame works fine as long as I didn't touch the path. And the changing of the path works fine but the insetFrame doesn't do anything except showing the spinning ball, that spins until I click somewhere on the pasteboard.

      Am I thinking wrongly or is there a bug that makes my idea impossible?

      Thank you
      Gerald