Copy link to clipboard
Copied
I have spent a fair amount of time with Illustrator over the years manually expanding appearances, outlining strokes, combining paths, etc. to get two-color art expanded into flat, outlined vectors. Doing this once for one piece of artwork isn't that big of a deal, but doing it for many pieces of artwork is bad in two ways: (1) it takes a long time, and (2) it makes the artwork uneditable unless I save a duplicate, which becomes a pain to track mentally. I'd like to keep an illustrator file of ~100 artboards fully editable, and then simply run a script to do the following any time I need to save out pngs from artboards, or otherwise export the art. For example:


If the images are hard to understand, I'm simply trying to take art that is black and white in appearance, and make black shapes out of the black parts. The script would create a separate .ai file so my original doesn't get expanded. Anyone seen anything like this? If not, any ideas about how to get there? I have little to no scripting experience.
Petros_
Copy link to clipboard
Copied
Hi Petros
The result you want to reach, from the origin you have, cannot be accomplished via script. The "Pathfinders" operations, like minus back, cannot be written via JavaScript.
Best Regards
Gustavo.
Copy link to clipboard
Copied
Bummer! It's a pretty mindless process — expanding graphics — which made me think it would be a good thing for a computer to handle on it's own. Wonder why those functions aren't accessible via script?
Copy link to clipboard
Copied
Just there´s no methods or properties avaliable to work with pathfinders. Yes, there´s the ability to combine 2 paths into a Compound Path, but this is not your case.
Best Regards
Gustavo.
Copy link to clipboard
Copied
Not everything is possible with scripting. But you still have a few options.
- save as with output flattening in pre AI9 format (and reopen this new file)
- or depending on the structure of your files: create an action on which does what you want and call the action via script
![]()
Copy link to clipboard
Copied
Hmm, can a script see whether two objects are overlapping? I guess even if it could it would still need to make a decision about when to use an action for uniting objects and when to use an action for subtracting objects. Above my paygrade, but thanks for the sounding board!
Copy link to clipboard
Copied
My first question would be "Why?" - but my first answer would be:
Have a look at invisible strokes. They can be used to "knock out" things in the back, if you group them and set the *group*'s transparency to "knockout group" (You can save this to a style and apply that).
I wrote a thing on dribbble explaining how to use this for a single path inner shadow effect: http://dribbble.com/shots/878685-Illustrator-single-style-live-inner-shadow?list=users
Good luck!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more