Copy link to clipboard
Copied
Hello,
I commonly come across outlined characters that have clipping masks, and other garbage. I have an action that breaks everything down to aid in cleaning it up. However, because the last step is Pathfinder - Exclude to knock out the center (or plugs as we call them) of letters like "A,B,D" I often run into an issue with over lapped character combos. Is there a way I can still break things down but keep the characters intact? This would be a whole lot easier if there were no compound pathed letters 🙂
The letters in the image are only outlined to illustrate the issue.
Thank you!
My Current Action Steps are:
Ungroup
Release Compound Path
Release Clipping Mask
Set Color to Rich Black
Pathfinder - Outline
Set Color to "Swap fill and stroke"
Ungroup
Pathfinder - Exclude
Ungroup
So, I already had an Ungroup script that seems to work just fine for this. Once you have the text isolated just run the script below and it will ungroup all nested groups and clipping masks leaving only letters and paths. For your example file, the gradient fill is actually a clipped rectangle so you would just need to delete that and then only have your letters left over. You could then run an action that does whatever color changes you need.
One last note: All of the characters in your sample
...Copy link to clipboard
Copied
So those letters should should stay different colors? And should overlap in that place?
Copy link to clipboard
Copied
Hi @Monika Gause,
Sorry I only used the separate colors to illustrate that they would be separate letters.
The end result should be letters that are all set to a fill of Rich Black. If they are overlapping in any way, I would want them to remain "whole" and overlapping versus having the overlapped parts knocked out.
Copy link to clipboard
Copied
I'm sorry, I still don't get it. So the letters being united is also not desired?
Copy link to clipboard
Copied
@Monika Gause Uniting the letters would not be desired (at least not this early in the design process).
Copy link to clipboard
Copied
Try disabling the Ungroup.
Copy link to clipboard
Copied
hello @Scott Falkner ,
I ran my action with each of the 3 different Ungroup steps disabled and with all of the Ungroup steps disabled. I end up with the same result of the overlapped area being excluded.
Copy link to clipboard
Copied
Actions are quick and easy to create but lack fine-grained control. A scripted solution may be more appropriate to your needs, being able to examine and manipulate individual objects within the document. Worth having a rummage online to see if there’s a cleanup script out there that already does what you want. Otherwise, if you don’t know how to script Illustrator yourself, someone here may be happy to create you a free/paid JavaScript if your needs are simple. You would need to provide more a detailed description of the artwork, what constitutes “garbage” vs wanted content, and some sample Before and After files for study. HTH
Copy link to clipboard
Copied
Ignore
Copy link to clipboard
Copied
This is a more realistic Example of how I receive the art and the first couple of steps I need to follow to break down and rebuild the art layout. I then tuned all of the type with knock-out issues Magenta (just for this post, not part of my workflow).
So maybe there is a way with a script that would do the breakdown for me without applying the "Exclude" Pathfinder on overlapping areas that are smaller than 0.05"W x 0.05"H
Copy link to clipboard
Copied
Since all letters are either simple pathItems or CompoundPathItems I think it should be pretty easy to get what you want via a script. After you isolate the letters from the stuff you don't need, you could just recursively dig into all of the sub items of the selection. If you encounter a letter (simple pathItem or a CompoundPathItem) move it before/after the selection, but if you encounter a group or clipped grouped (clipping mask) dig into it and look for any enclosed pathItems or CompoundPathItems.
Copy link to clipboard
Copied
So, I already had an Ungroup script that seems to work just fine for this. Once you have the text isolated just run the script below and it will ungroup all nested groups and clipping masks leaving only letters and paths. For your example file, the gradient fill is actually a clipped rectangle so you would just need to delete that and then only have your letters left over. You could then run an action that does whatever color changes you need.
One last note: All of the characters in your sample file are compound paths even if they don't need to be (e.g. "I"). This doesn't really cause an issue, I just wanted to point it out.
// Ungroup.jsx
var doc = app.activeDocument;
var sel = doc.selection;
if (sel.length > 0) {
for (var i = 0; i < sel.length; i++) {
ungroup(sel[i]);
}
}
/**
* Ungroup a groupItem within Adobe Illustrator. Similar to `Object > Ungroup`
* @Param {*} object An Adobe Illustrator groupItem
* @Param {*} recursive Should nested groupItems also be ungrouped
*/
function ungroup(object, recursive) {
// if a non group item is passed just return
if (object.typename != "GroupItem") {
return;
}
recursive = typeof recursive !== "undefined" ? recursive : true;
var subObject;
while (object.pageItems.length > 0) {
if (object.pageItems[0].typename == "GroupItem" && !object.pageItems[0].clipped) {
subObject = object.pageItems[0];
subObject.move(object, ElementPlacement.PLACEBEFORE);
if (recursive) {
ungroup(subObject, recursive);
}
} else {
object.pageItems[0].move(object, ElementPlacement.PLACEBEFORE);
}
}
}
Copy link to clipboard
Copied
@jduncan thanks I'll test it out on some files i receive and get back to you!
Copy link to clipboard
Copied
So the Ungroup script didn't quite work out as planned.
Is there a way to exclude overlapping vectors only if they have an area larger than 3px?
Copy link to clipboard
Copied
@BryanPagenkopf what's not working with this? Here's a video of me running my ungroup script on the sample text you supplied in the PDF file above. After running the script all of the letters are left intact, and the overlapping letters are still solid... Am I missing something?