Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Activate overprint fill to selection / objects / swatches with script.

Contributor ,
Feb 07, 2023 Feb 07, 2023

Hi community, I don't really have a code to show for this, but I was trying to find out how to set the overprint fill attribute to my object/selection/swatches, I wrote it like this because I am not sure how does it work, all I know is that to activate overprint filll for text frames is:

 

text.textRange.characterAttributes.overprintFill = true;

 

Can anyone help me out with that? Thank you.

 

(P.s.: I did look at the documentation for scripting but all I found is overprint for pdf files something like that)

TOPICS
Draw and design , Feature request , Scripting , Tools
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Contributor , Feb 08, 2023 Feb 08, 2023

Hi! I made this:

 

var doc = app.activeDocument;
var layers = doc.layers;
doc.artboards.setActiveArtboardIndex(0);
layers.hasSelectedArtwork = true;
for(var i=0; i < doc.selection.length; i++){
doc.selection[i].fillOverprint = true;
}

 

and in fact it activates the fill overprint attributes, I just don't know why somethines it does not activate for compound path items, but so far... this works! Hope it helps.

Translate
Community Expert , Feb 11, 2023 Feb 11, 2023

You might need some more code to handle CompoundPathItems and GroupItems. For example

if (doc.selection[i].constructor.name == 'CompoundPathItem')
     doc.selection[i].pathItems[0].fillOverprint = true;

And GroupItems have pageItems, so you can do another loop over the group's pathItems and set each of their fillOverprints too.

- Mark

Translate
Adobe
Community Expert ,
Feb 07, 2023 Feb 07, 2023

Hi @AntonioPacheco, have another look at the docs, for example PathItem has fillOverprint and strokeOverprint properties. - Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 07, 2023 Feb 07, 2023

ohh wow I didn't know about that web page! Normally I use https://ai-scripting.docsforadobe.dev/
Let me take a look.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2023 Feb 07, 2023

Yes it has some more up-to-date info, but is almost the same. The page on PathItem seems to be the same.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 07, 2023 Feb 07, 2023

Thank you so much! I'm reading right now, after that I'll try some for(){} loops to toggle the filloverprint attribute to the pathitems on my selection.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 07, 2023 Feb 07, 2023

I've been trying for a couple of hours, no results so far but I'll find a way!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 08, 2023 Feb 08, 2023

Hi! I made this:

 

var doc = app.activeDocument;
var layers = doc.layers;
doc.artboards.setActiveArtboardIndex(0);
layers.hasSelectedArtwork = true;
for(var i=0; i < doc.selection.length; i++){
doc.selection[i].fillOverprint = true;
}

 

and in fact it activates the fill overprint attributes, I just don't know why somethines it does not activate for compound path items, but so far... this works! Hope it helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 11, 2023 Feb 11, 2023
LATEST

You might need some more code to handle CompoundPathItems and GroupItems. For example

if (doc.selection[i].constructor.name == 'CompoundPathItem')
     doc.selection[i].pathItems[0].fillOverprint = true;

And GroupItems have pageItems, so you can do another loop over the group's pathItems and set each of their fillOverprints too.

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines