Salir
  • Comunidad global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

Pathfinder Unite all objects on each layer

Explorador ,
Aug 01, 2016 Aug 01, 2016

I wonder if someone can help me to make script, wich doing unite shape mode via pathfinder on all objects on each layer.

Manually i activate one layer, pushing ctrl + a, then clicking on Unite shape mode button. Then layers are more then 50, it making big peace of time.

TEMAS
Scripts
1.6K
Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines

correct answers 1 respuesta correcta

Participante , Aug 08, 2016 Aug 08, 2016

Piggybacking off of pixxxel schubser

function MergeAllLayers() {

    // exit early if there are no files open

    if( !app.documents.length ) return;

    var doc = app.activeDocument;

   

    // clear selection

    doc.selection = null;

   

    // loop through all layers

    var layers = doc.layers;

    for( var i = 0, ii = layers.length; i < ii; i++ ) {

       

        // select everything on the current layer

        layers.hasSelectedArtwork = true;

       

        app.executeMenuCommand("group"); 

     

...
Traducir
Adobe
Community Expert ,
Aug 01, 2016 Aug 01, 2016

Hi arop16461101​,

in Illustrator DOM isn't a direct command for the pathfinder available.

But:

Are there only simple paths in your selection?

And your Illustrator version is newer than CS5?

You can try something like this (only CS6+ 😞

// select 2 or more path items

app.executeMenuCommand("group");

app.executeMenuCommand("Live Pathfinder Add");

app.executeMenuCommand("expandStyle");

Have fun.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Participante ,
Aug 08, 2016 Aug 08, 2016

Piggybacking off of pixxxel schubser

function MergeAllLayers() {

    // exit early if there are no files open

    if( !app.documents.length ) return;

    var doc = app.activeDocument;

   

    // clear selection

    doc.selection = null;

   

    // loop through all layers

    var layers = doc.layers;

    for( var i = 0, ii = layers.length; i < ii; i++ ) {

       

        // select everything on the current layer

        layers.hasSelectedArtwork = true;

       

        app.executeMenuCommand("group"); 

        app.executeMenuCommand("Live Pathfinder Add"); 

        app.executeMenuCommand("expandStyle"); 

       

        // clear selection

        doc.selection = null;

    }

}

MergeAllLayers();

Setting the hasSelectedArtwork Layer property equal to true is a fun trick to select everything on a layer, you just have to make sure to clear any other selection first.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Aug 08, 2016 Aug 08, 2016
MÁS RECIENTES

I thought that now I will always do it manually. So, many thanks to u! It works  so fast!!!

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines