Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"Break apart" or "Ungroup" all texts in a .fla file

New Here ,
Feb 15, 2018 Feb 15, 2018

Hi,

I often have the case that when i finished banner production i would like to break apart all fonts in a document at once. Now I have to type and select each text object and make Command + B (MAc) twice for each. That's quiet time consuming. Does anyone have an idea how I could speed up this process?

Thanx for ideas.

2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 16, 2018 Feb 16, 2018

well, breakApart() is quirky.  you need to unlock layers and select the layer/frame with text and do it carefully.

here's how to do it:

var tl = fl.getDocumentDOM().getTimeline();

breakApartF();

breakApartF();

lockLayersF(false);

function breakApartF() {

for (var layerNum = 0; layerNum < tl.layerCount; layerNum++) {

for (var frameNum = 0; frameNum < tl.layers[layerNum].frameCount; frameNum++) {

var textA = [];

for (var elementNum = tl.layers[layerNum].frames[frameNum].elements.length - 1; elementNum >= 0;

...
Translate
Community Expert ,
Feb 15, 2018 Feb 15, 2018

you can use jsfl.

var tl = fl.getDocumentDOM().getTimeline()

for (var layerNum = 0; layerNum < tl.layerCount; layerNum++) {

for (var frameNum = 0; frameNum < tl.layers[layerNum].frameCount; frameNum++) {

for (var elementNum = 0; elementNum < tl.layers[layerNum].frames[frameNum].elements.length; elementNum++) {

var element = tl.layers[layerNum].frames[frameNum].elements[elementNum];

if(element.elementType=='text'){

fl.getDocumentDOM().selection = [element];

fl.getDocumentDOM().breakApart();

fl.getDocumentDOM().breakApart();

}

}

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2018 Feb 15, 2018

that first breakApart() is going to increase the number of text items so you'll need to edit that code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2018 Feb 16, 2018

well, breakApart() is quirky.  you need to unlock layers and select the layer/frame with text and do it carefully.

here's how to do it:

var tl = fl.getDocumentDOM().getTimeline();

breakApartF();

breakApartF();

lockLayersF(false);

function breakApartF() {

for (var layerNum = 0; layerNum < tl.layerCount; layerNum++) {

for (var frameNum = 0; frameNum < tl.layers[layerNum].frameCount; frameNum++) {

var textA = [];

for (var elementNum = tl.layers[layerNum].frames[frameNum].elements.length - 1; elementNum >= 0; elementNum--) {

var element = tl.layers[layerNum].frames[frameNum].elements[elementNum];

if (element.elementType == 'text') {

textA.push(element);

}

}

if(textA.length>0){

tl.currentLayer = layerNum;

tl.currentFrame = frameNum;

fl.getDocumentDOM().selection = textA;

fl.getDocumentDOM().breakApart();

}

}

}

}

function lockLayersF(b) {

for (var i = 0; i < tl.layerCount; i++) {

tl.layers.locked = b;

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 16, 2018 Feb 16, 2018

Hey now kglad, I'm sure kglad knows what he's doing here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2018 Feb 16, 2018

i wouldn't be so sure...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 20, 2018 Feb 20, 2018

Hi kglad,

Thank you for your help. I have two questions regarding this:

1 - Were do you put the code? Is it a sort of script to set up and run on layers?

2 - If i Have to "unlock every layer and select the select carefully" than it's the same work as if I use Command+B right? What is the advantage of this script then?

Thanx a lot

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2018 Feb 20, 2018
LATEST

you don't have to unlock anything.  the code handles that.

you copy and paste into a jsfl file, you open your fla (with the text)>click commands>run command>and navigate to that jsfl file.

use a copies of your first few flas to make sure it works the way you want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines