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

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

Explorer ,
Jan 24, 2011 Jan 24, 2011

Hello:

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

Example: the textFrame "Letters" will be divided in 7 textFrames: "L", "e", "t", "t", "e", "r", "s".

Help, please.

TOPICS
Scripting
42.1K
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 , Mar 05, 2011 Mar 05, 2011

Hi Victor, here's the JS version, sorry for the delay

#target Illustrator

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

//  script.required = select a point text textFrame before running;

//  script.parent = CarlosCanto;  // 3/5/11

//  script.elegant = false;

var idoc = app.activeDocument;

var tWord = idoc.selection[0];

var xpos = tWord.position[0];

var ypos = tWord.position[1];

var charCount = tWord.characters.length;

for (i=charCount-1 ; i>=0 ; i--)

     {

          var ichar

...
Translate
Adobe
New Here ,
Oct 23, 2013 Oct 23, 2013

Hi Carlos, I've been reading a lot of your responses across several related topics and I think you may be able to help me.

I edit a lot of pdfs from CAD programs and Excel files in Illustrator CS6. Often the pdfs text imports each letter as an individual frame. I found a script called "JoinTextFrames" which allows me to relink the individual letters together when the are selected mannualy as a word or number value.

The script works alright but especially in the excel files it gets tedious to select each group of numbers or string of letters. Also, its not consistant with puctuation like commas, periods or other glyphs.

Would you know a better way script Illustrator to search say at an artboard level; and go across a document identifying each word/number group, based on the coordinates that are touching, to make whole words and numbers?

Long time Adobe user but noob at scripting, Sorry for the long reply. Thanks!

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 ,
Oct 24, 2013 Oct 24, 2013

interesting, not sure if it can be easily accomplished...can you share a file?

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 ,
Oct 25, 2013 Oct 25, 2013

Carlos, I've sent you a private message with links to sample files. Thanks for offering to take a look!

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 ,
Nov 19, 2013 Nov 19, 2013

Many Thanks to CarlosCanta who provided me an excellent script for merging text intelligently!

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
Explorer ,
Mar 20, 2024 Mar 20, 2024

Hi, I am trying to use the script that creates textframe for each word but I am getting this error. Would you know how to fix this please?

Textframe to words script error please helpTextframe to words script error please help

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 ,
Mar 21, 2024 Mar 21, 2024

Hello, I posted an updated script, it's on page 3 on this thread

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 ,
Jan 05, 2014 Jan 05, 2014

diagonal.pngthis was very very helpful guys thank you all ..

i just wanted some help when applying the same division functionality on a diagonal text frame , i.e a rotated text frame that's neither perfectly vertical nor horizontal

the image i attached shows a diagonal case of those i'm dealig with

thnx in advance

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 ,
Jan 13, 2014 Jan 13, 2014

Hi Sarah, not as easy as I though...stay tuned

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 ,
Jul 13, 2015 Jul 13, 2015

hi,

i want to use this script inside Indesgin CS3 ME,CS5.5 ME. it's very important to me

Thank you

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 ,
Jul 13, 2015 Jul 13, 2015

sorry but this is for Illustrator only script, try asking in the ID scripting forum if someone could rewrite it to make it work in ID.

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 Beginner ,
May 18, 2016 May 18, 2016

Thanks man!!!! Very hepful,

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
Explorer ,
Oct 28, 2019 Oct 28, 2019

Hi Carlos,

When I use either your 'characters' or 'words' script, I get the following error message.  I'm using CC2019.

 

Screen Shot 2019-10-28 at 2.35.26 PM.png

Any ideas why that's happening?

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 Beginner ,
Oct 28, 2019 Oct 28, 2019

I receive the same error, and would also love this function to pieces.
Adobe CC 2019 on MacAdobe CC 2019 on Mac

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 ,
May 18, 2015 May 18, 2015

sorry to be such a noobie, but what am I supposed to do with this buch of text ? I tried to copy it text edit, then save it, then rename the extension to .js and place it in the script folder of my illustrator but I have always error to load. Am I doing things correctly ?

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
Guide ,
May 18, 2015 May 18, 2015

I would recommend saving as .jsx not .js

Note: if you are on pc and you don't have extensions of known file types showing, then it may not be changing the extension properly.

using the ESTK is recommended.

also there is more then 1 script folders.

the path should be like this...

C:\Program Files\Adobe\Adobe Illustrator CC 2014\Presets\en_GB\Scripts

once saved in there you will need to restart illustrator

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 ,
May 18, 2015 May 18, 2015

not being familiar with mac, I guess you have to save as Plain Text, Text Edit's default is Rich Text, right?

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
Guide ,
May 18, 2015 May 18, 2015

Guess its worth recommending the use of ESTK.

it is happy to save JSX in the correct format.

well it should be...

Thats why it exists.

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 ,
May 18, 2015 May 18, 2015

true, but for some strange reason, non-scripters have a really hard time finding and/or using it...every time I have suggested it over the years.

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
Guide ,
May 18, 2015 May 18, 2015

for those running Win7 ( and prob win 8 or 10 😞

Press the Win key, win key.JPG

then type extendscript.

first option should be your extendscript toolkit

start.JPG

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
Mentor ,
May 19, 2015 May 19, 2015

It's the same via OSX using spotlight search: "extendscript" (you will then see the Extendscript Toolkit)

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
Mentor ,
May 19, 2015 May 19, 2015

CarlosCanto wrote:

not being familiar with mac, I guess you have to save as Plain Text, Text Edit's default is Rich Text, right?

OSX TextEdit app defaults to rich text, it can be changed per document to "plain text" via:

Format (menu) > Make Plain Text

Or can be made the default for new documents via:

Preferences (menu) > Format > Plain Text

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 Beginner ,
Jan 11, 2017 Jan 11, 2017

Hi Carlos,

This is brilliant. I too have a small request. Can you please give me a script where I can split a paragraph into individual lines. For example, if there is a paragraph with 10 lines, the final output after executing the code should be 10 different lines. It will save tons of my time. Thanking you in anticipation....

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 ,
Jan 11, 2017 Jan 11, 2017

sure, use DivideTextFrame script by Wundes, look here

wundes.com

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 Beginner ,
Jan 12, 2017 Jan 12, 2017

Thanks Man.

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 ,
Sep 09, 2020 Sep 09, 2020

Hi Carlos,

 

I tried your script splitSelectedWordsIntoCharacters.jsx, saved it as a JSX files, opened it through the Adobe Illustrator 2020 File > Scripts > Other scripts... Menu but I got the below error. Same happend when I tried the JS script. Could you tell me what I'm doing wrong? It seems to be working for everyone else. I'm on a Windows 10 OS.

 

sonjageracsek_0-1599665163364.png

 

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