Skip to main content
This topic has been closed for replies.
Correct answer pixxxelschubser

@Stefan Cargoski 

As I said before: the migration of the forum has destroyed many good old scripts.

 

Replace:

 

ichar.contents = tWord.characters.contents;
tWord.characters.remove();

 

with:

 

ichar.contents = tWord.characters[i].contents;
tWord.characters[i].remove();

 

 

4 replies

m1b
Brainiac
February 5, 2022

This question is well and truly answered, but for those who are interested, I posted a further version of the splitting script under the original post. It has a few advantages I think.

- Mark

pixxxelschubser
Adobe Expert
February 5, 2022

Hi @Ton Frederiks 

You were two minutes faster.

😉

Ton Frederiks
Adobe Expert
February 5, 2022

Happens to me all the time 🙂

pixxxelschubser
pixxxelschubserCorrect answer
Adobe Expert
February 5, 2022

@Stefan Cargoski 

As I said before: the migration of the forum has destroyed many good old scripts.

 

Replace:

 

ichar.contents = tWord.characters.contents;
tWord.characters.remove();

 

with:

 

ichar.contents = tWord.characters[i].contents;
tWord.characters[i].remove();

 

 

Inspiring
February 5, 2022

Thank you!

pixxxelschubser
Adobe Expert
February 5, 2022

There are several script versions in the linked thread. Please link to the specific script or post the code. The (new) forum migration to Khoros really messed up with the arrays. Mostly a counter like [i] is missing.

Inspiring
February 5, 2022

This is the script which is shown as correct:

 

 

#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 = tWord.duplicate();

          ichar.contents = tWord.characters.contents;

          tWord.characters.remove();

          var width = tWord.width;

          ichar.position = [xpos+width,ypos];

     }

tWord.remove();

Ton Frederiks
Adobe Expert
February 5, 2022

I have an older version and as pixxelschubser remarked the [i] is missing. Here is the old version:

#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 = tWord.duplicate();  
          ichar.contents = tWord.characters[i].contents;  
          tWord.characters[i].remove();  
          var width = tWord.width;  
          ichar.position = [xpos+width,ypos];  
     }  
tWord.remove();