Skip to main content
Known Participant
April 14, 2014
Question

How can I add spot swatches name in filled objects

  • April 14, 2014
  • 2 replies
  • 485 views

Hi All,

How can I add SPOT color swatches name as a text in appropriate applied fill Frames, the text should paper color. Please see below screenshot for details

Thanks in advance

Steve

This topic has been closed for replies.

2 replies

Chinnadk
Legend
April 14, 2014

Hi Steve,

Try this,

var doc = app.activeDocument;

var pageitems = doc.allPageItems;

for(var i=0;i<pageitems.length;i++)

{

        if(pageitems.fillColor.model == ColorModel.SPOT)

        {

                pageitems.insertionPoints.item(0).contents = pageitems.fillColor.name;

                pageitems.parentStory.fillColor = doc.swatches.item("Paper");

            }

    }

Regards,

Chinna

Jump_Over
Legend
April 14, 2014

Hi,

1. create a paraStyle to determine text size, color and other properties (let say the name is "regis").

2. if target frame is selected:

app.selection[0].contents = app.selection[0].fillColor.name;

app.selection[0].parentStory.appliedParagraphStyle = app.activeDocument.paragraphStyles.item("regis");

Jarek

AsOneAuthor
Known Participant
April 14, 2014

Hi Jump_Over,

Thanks for your reply,

I want to select and add text for spot colors only.

Thanks

Steve