Convert rich blacks to flat black
Finds all items with enhanced blacks in the artwork and changes their color to flat black.
It has no prompts because it should work inside a Batch action.
Save the file and drop it onto the artboard. Or copy it to Illustrator's Scripts folder and launch it from File > Scripts
Default settings are to flatten any color with more than 90%K and 300% coverage.
To change this limit open the .jsx file in a text editor and change var maxBlack = 95
and var minCoverage = 300
to your desired values.
You can add this to an action by using Insert Menu Item. Then save your action to an .aia file ( ▾☰ > Save Actions... ).
- Fix Target layer cannot be modified error – locked layers support
@shauntur So glad this was useful to you, and thanks for sharing your great contributions!
The use cases you outline sound like common problems, I'm a little surprised we had to script to handle them. For batch jobs there could be a simpler config language where you can declare stuff like preflight checks and lookup-table substitutions like these ones (flatten blacks, flatten greys).
P.S. The mess is mostly on the surface, try using a text editor / IDE for code formatting and enforcing a style. Visual Studio Code, Prettier