Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to divide all textFrames in one-character-per-textFrame? Illustrator 2021

Community Beginner ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

Hi guys,
I found a perfect Script for what i'm trying to achive written by @CarlosCanto  but i'm wondering if because it was written in 2011 it's not working. I'm trying to split a lock of copy into individule text frames for each charachter while keeping each charachter in the same position. Please note i'm very new to scripts. 

 #target Illustrator

 

//  script.name = splitSelectedWordsIntoCharacters.jsx;

//  script.description = splits selected texFrames into separate characters;

//  script.required = select point text textFrames before running;

//  script.parent = CarlosCanto;  // 4/13/11

//  script.elegant = false;

 

var idoc = app.activeDocument;

var sel = idoc.selection; // get selection

var selCount = sel.length; // count items

var tWord = []; // to hold the textFrames

 

for (j=selCount ; j>0 ; j--) // loop thru selection & get textFrames backwards

     {

          tWord[j-1] = sel[j-1];

     }

 

 

for (k = 0 ; k<tWord.length ; k++) // loop thru textFrames

     {

          var xpos = tWord.position[0]; // get x

          var ypos = tWord.position[1]; // get y

          var charCount = tWord.characters.length; // count characters

 

          for (i=charCount-1 ; i>=0 ; i--) // loop thru characters backwards

               {

                    var ichar = tWord.duplicate(); // duplicate textFrame

                    ichar.contents = tWord.characters.contents; // get last character

                    tWord.characters.remove(); // remove last character from original word

                    var width = tWord.width; // get the new width (without the last character)

                    ichar.position = [xpos+width,ypos]; // position the character = original position + new width

               }

          

          tWord.remove(); // remove textFrame (it is empty by now)

 

     }

TOPICS
Scripting

Views

157

Likes

Translate

Translate

Report

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

Advocate , Nov 10, 2021 Nov 10, 2021
The script is designed for point type.  You are probably using area type.  Convert area type to point type and try again. 

Likes

Translate

Translate
Community Beginner ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

This is the error I'm getting.

Likes

Translate

Translate

Report

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
Explorer ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

You copied an old version of the script. Carlos posted a new version on the forum in 2019. Check this

https://community.adobe.com/t5/illustrator-discussions/how-to-divide-all-textframes-in-one-character...

Likes

Translate

Translate

Report

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 Beginner ,
Nov 10, 2021 Nov 10, 2021

Copy link to clipboard

Copied

Thank you for that, It helps solve the error however I need the characters to stay in the same position. e.g. "WORD" turns into "W,O,R,D" the script linked layers every letter on top of each other. 

Likes

Translate

Translate

Report

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
Explorer ,
Nov 10, 2021 Nov 10, 2021

Copy link to clipboard

Copied

Could you record an example or upload your file? I checked on CC 2019 and CC 2022, the script works without problems

SergeyOsokin_0-1636544321832.png

 

Likes

Translate

Translate

Report

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 Beginner ,
Nov 10, 2021 Nov 10, 2021

Copy link to clipboard

Copied

Thanks for your help. So odd and frustrating. Here is what happens when I run the Script in illustrator 2022 on my mac OS Monterey.

Likes

Translate

Translate

Report

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
Advocate ,
Nov 10, 2021 Nov 10, 2021

Copy link to clipboard

Copied

The script is designed for point type.  You are probably using area type.  Convert area type to point type and try again. 

Likes

Translate

Translate

Report

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 Beginner ,
Nov 11, 2021 Nov 11, 2021

Copy link to clipboard

Copied

LATEST

Amazing thank you @femkeblanco and @Sergey Osokin !!!

Likes

Translate

Translate

Report

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