Copy link to clipboard
Copied
I want to change fill opacity to 62.
pathItem.opacity = 62;
but it changed entire opacity not fill opacity.
Any Ideas?? Please help.
Copy link to clipboard
Copied
There are unfortunately many many limitations to scripting in Illustrator. Since ExtendScript Toolkit was retired I haven't figured out any way to browser the JavaScript API but looking at the AppleScript dictionary the opacity properties that exist only seem to apply to full objects. So my best guess would be that what you're asking to do simply isn't possible.
Copy link to clipboard
Copied
What happens if you use pathItem.fillColor.opacity = 62?
Copy link to clipboard
Copied
nothing will happen Larry, color object does not have opacity property. You would actually assign your own opacity property that you could read later like any other variable.
Copy link to clipboard
Copied
as mentioned, opacity is applied to objects, not to fill or stroke.
to work around that, you could record an Action that assigns the opacity of your choice, then have your script play such action. It works beautifully.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now