Copy link to clipboard
Copied
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)
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.
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
Copy link to clipboard
Copied
Hi @AntonioPacheco, have another look at the docs, for example PathItem has fillOverprint and strokeOverprint properties. - Mark
Copy link to clipboard
Copied
ohh wow I didn't know about that web page! Normally I use https://ai-scripting.docsforadobe.dev/
Let me take a look.
Copy link to clipboard
Copied
Yes it has some more up-to-date info, but is almost the same. The page on PathItem seems to be the same.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I've been trying for a couple of hours, no results so far but I'll find a way!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more