Skip to main content
Participating Frequently
February 21, 2016
解決済み

How can I quickly add an identical stroke color to a filled shape for hundreds of selected objects at the same time

  • February 21, 2016
  • 返信数 3.
  • 899 ビュー

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

このトピックへの返信は締め切られました。
解決に役立った回答 Larry G. Schneider

Why don't you try just using Object>Path>Offset path and use a small number (>0.005 or so).

返信数 3

wastedpixels作成者
Participating Frequently
February 22, 2016

‌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!

Qwertyfly___
Legend
February 22, 2016

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...

Qwertyfly___
Legend
February 22, 2016

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;

}

wastedpixels作成者
Participating Frequently
February 22, 2016

‌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

Larry G. Schneider
Community Expert
Community Expert
February 21, 2016

Why don't you try just using Object>Path>Offset path and use a small number (>0.005 or so).

wastedpixels作成者
Participating Frequently
February 22, 2016

‌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

Silly-V
Legend
February 22, 2016

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.