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

Ungroup all from selection

Principiante de comunidad ,
Apr 16, 2024 Apr 16, 2024

Hello:) i was trying to find something which will help me to Ungroup everything from selection to be able to add it on Action. I cant use normal ungroup becuase if i use it few times (in case there is more groups in selection) then script is stopping becuase there are no groups. So i tried script like this:

var doc;

function getChildAll(obj) {
var childsArr = [];
for (var i = 0; i < obj.pageItems.length; i++) {
childsArr.push(obj.pageItems[i]);
}
return childsArr;
}

function ungroupSelection() {
var selection = doc.selection;
for (var i = 0; i < selection.length; i++) {
var item = selection[i];
if (item.typename == "GroupItem") {
var elements = getChildAll(item);
for (var j = 0; j < elements.length; j++) {
elements[j].moveBefore(item);
}
item.remove();
ungroupSelection(); // Recursively ungroup newly ungrouped items
}
}
}

if (app.activeDocument) {
doc = app.activeDocument;
if (doc.selection.length > 0) {
ungroupSelection();
} else {
alert("Please make a selection before running this script.");
}
} else {
alert("Please open a document before running this script.");
}


Script is working but its showing me error like in attachment. How i can avoid it? or maybe there is some easier way to ungroup everything from selection?

TEMAS
Scripts
6.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
Adobe
Aficionado ,
Apr 17, 2024 Apr 17, 2024

You may find the ExtUngroup script useful. Choose Target > Selected objects and Options > Ungroup all.

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 ,
Jul 31, 2024 Jul 31, 2024
 

Hello! I found that your script "ExtractFromGroup" does not seem to be suitable for Adobe Illustrator 28.6. It does not move objects out of the group. After running it, there are no changes.

3444334.gif

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
Aficionado ,
Jul 31, 2024 Jul 31, 2024

I can't confirm your problem with ExtractFromGroup script. Tested on AI v28.6 on Mac OS Monterey and Windows 10. The script works. Have you tried running it from the File > Scripts menu instead of the ScripshonTrees extension?

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
Principiante de comunidad ,
Jul 31, 2024 Jul 31, 2024

It is working 🙂 i probably forgot to write here. Thanks anyway

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
Community Expert ,
Aug 01, 2024 Aug 01, 2024

笠間38198967ieha,

 

your screenshot indicates that you are selecting ungrouped objects on a sublayer (called "a"). It's not a group.

 

That's why you may think the script does not work. Try it with a genuine group.

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 02, 2024 Aug 02, 2024

Thank you for your keen observation. I realized that I had confused the concept of what "a" belongs to. "a" is indeed a sublayer, but I mistakenly treated it as a group object.

So, here's the issue: how can I release objects from a sublayer and place them before the sublayer? The reason I need this is that when I break symbol links, the objects always remain within the sublayer. However, I want them to be released from the sublayer and maintain the layer order after breaking the symbol links. Then, I want to delete the unnecessary sublayer that stored the symbol object, because the symbol has been converted back to a regular object, making the sublayer redundant. If the symbol is converted back again, it would be nested in another sublayer.

To solve this issue, I searched for solutions and came across Sergey Osokin's plugin. I mistakenly thought it could release objects from sublayers and move them above the sublayer.

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
Community Expert ,
Aug 02, 2024 Aug 02, 2024

This may also be scripted, and I seem to remember that there is already a script that does it (probably from Sergey as well).

 

In the meantime, you may highlight all sublayers, execute the "Merge Selected" command in the Layers palette menu, and then highlight and drag all objects above the merged sublayer onto any main layer.

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 02, 2024 Aug 02, 2024

Unfortunately, I couldn't find that thing.

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
Aficionado ,
Aug 02, 2024 Aug 02, 2024

Try this script "Break Link to Symbol" by Seiji Miyazawa. It breaks symbol and converts it into groups.

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 02, 2024 Aug 02, 2024
MÁS RECIENTES

Thank you, Sergey Osokin! You are as excellent as ever. I really appreciate you discovering this—it's exactly what I needed!

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