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

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

499

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

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

Votes

Translate

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

Copy link to clipboard

Copied

This is the error I'm getting.

Votes

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

Votes

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. 

Votes

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
Enthusiast ,
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

 

Votes

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.

Votes

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

Votes

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

Votes

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