2 Replies Latest reply on Mar 18, 2010 12:14 AM by alam_84

    Applying a stroke color to a rectangle


      Hi All,


      I want to apply "Red", "Yellow", "Green" one at a time as a stroke color to the rectangle

      On looking into the pageitem property I have found that I can do the above thing as follows

      selectedPageItem.strokeColor = MyColor

      But the above proprty needs a swatch type variable.

      To handle this I tried following.

      // I added a red color on swatch panel

      activeDoc.colors.add("R=100 G=0 B=0");

      then tried to set stroke color as follows

      selectedObjects[0].strokeColor = activeDoc.swatches.item("R=100 G=0 B=0");

      But above statement throws an exception.


      If anybody have done this then please let me help to achieve this