Copy link to clipboard
Copied
Hi community.
I tried to run a script which breaks up text to become individual object, but still live text, and I get this following error
Original post can be viewed here:
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 = tW...
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();
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
Finally it worked.
Kind regards.
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
Thank you!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Happens to me all the time 🙂
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more