Copy link to clipboard
Copied
I have an illustration with hundreds of small shapes thet are exactly adjacent. However Illustrator seems to show a small seem nonetheless.
Is there a way to select all my objects and have a script stroke them with the same color as theri individual fill?
Albert
Why don't you try just using Object>Path>Offset path and use a small number (>0.005 or so).
Copy link to clipboard
Copied
Why don't you try just using Object>Path>Offset path and use a small number (>0.005 or so).
Copy link to clipboard
Copied
‌hi Larry,
thanks for this suggestion. This way it would generate a lot of extra 'hard' geometry (running in the thousands of extra paths) so that would be a problem.
Albert
Copy link to clipboard
Copied
It may be possible to achieve the offset suggestion via a live effect which may save on the extra paths. This could theoretically be applied via script in CS6+, it could probably be done by using both the live effect and the action-play workaround to make a new graphic style, selecting all and applying that style to the entire selection. Or, if there is a way to 'click' the graphic style button or apply the live effect to an entire selection, it could be done without having to use the action within the script.
Copy link to clipboard
Copied
I'm not talking about an using an effect. The Object>Path>Offset path will enlarge the objects by the amount specified and can be used to overlap slightly the paths to get rid of the visual edges. You can do it by creating an Action and assigning it an F-key for one click application.
Copy link to clipboard
Copied
Well he doesn't want to use the Path > Offset Path menu item due to creation of extra paths, so he may as well do the same thing with an effect.
As for the graphic style, it's possible to create a 'generic' offset path style which has no fill & stroke, just the offset path effect, from a temporary dummy object and save the custom graphic style from it. If applied to a filled shape with a click, it will of course completely override all appearance, making it a clear path - however, alt-clicking it will add it onto the appearance of the filled shape, offsetting it as expected. I think if this was to be scripted in its entirety, actions will need to be used to apply the graphic style to the selection without resorting to looping.
Copy link to clipboard
Copied
How is this going to create extra paths? I don't understand the reluctance to use the UI. I did a whole series of modeling maps at my old jobs using this method and it worked great. No extra paths were created and I was able to use the Add pathfinder to create significant savings on the total anchor point count.
Copy link to clipboard
Copied
The offset path menu item creates one offset path for every selected object, so perhaps while you simply added the shapes, this user wants to keep all their fill colors different from each other. Also there's little difference in using the UI to apply this menu item or the live effect version, but inserting the live version into an action will only produce a dialog box. However, I do believe it would be possible to use the menu item and a series of note-setting & selecting to remove the original path and only leave the new one to do this automatically with an action.
Copy link to clipboard
Copied
if you really want to do this with a script, (as it may be part of a larger process)
var doc = app.activeDocument;
var pths = doc.pathItems;
for(var i=0; i<pths.length; i++){
var pth = pths;
pth.stroked = true;
pth.strokeWidth = .5;
pth.strokeColor.cyan = pth.fillColor.cyan;
pth.strokeColor.magenta = pth.fillColor.magenta;
pth.strokeColor.yellow = pth.fillColor.yellow;
pth.strokeColor.black = pth.fillColor.black;
}
Copy link to clipboard
Copied
‌HI qwertyfly,
I'll test out your script and see if that's the option I was looking for. I am curious about what you mean with 'part of a larger process'?
Albert
Copy link to clipboard
Copied
Qwertyfly‌
Maybe stupid question but how do I get this script to run? I tried saving with an extension of .scpt but Illustrator just flashes a simple warning dialog box...
Albert
Copy link to clipboard
Copied
‌hi all,
In light of my having to solve this fast the option with offset path at least gets rid of the lines.
that way I can get them rasterized properly (Photoshop minimum filter does not get lower than a whole pixel)
Thanks for all your input!
Copy link to clipboard
Copied
as for running the script it should be saved as .jsx
then go to File>Scripts>Other Script... and choose the .jsx file you just saved
as for larger process, if this was just one stage in a larger script.
you may have a situation where you want to process 30 files.
along with this snippet you may want to fit to a set page size, export a low res PNG, save as a PDF, and log the number of pathitems per file to a textfile.
so now this snippet is just part of a larger process...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now