Mobile app version of vmapp.org
Login or Join
Gail6891361

: Illustrator: Edit text in multiple text boxes at the same time I have two text boxes that I need to have identical text, but in different fonts. Is there any way I can edit only the text

@Gail6891361

Posted in: #AdobeIllustrator #DataMerge #IllustratorScripting #Text #Typography

I have two text boxes that I need to have identical text, but in different fonts. Is there any way I can edit only the text content of both at the same time (keeping the fonts different).

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Gail6891361

3 Comments

Sorted by latest first Latest Oldest Best

 

@Lengel450

Here's a modification that allows you to select groups and it changes the text within those groups. This works on nested levels (groups within groups) or on selected text layers directly.
#target illustrator
function ChangeTextContents(){
if(app.documents.length > 0 && app.documents[0].selection != null){
var newText = prompt("Enter new text:", "");
if(newText != null){
var sel = app.activeDocument.selection;
for(var i=0; i < sel.length; i++){
ChangeElement(sel[i],newText);
}
}
}
}

function ChangeElement(thisSelection,text) {
// For each selected item, determine if it is text or a group
// For text items, just change the contents
if(thisSelection.typename == "TextFrame"){
thisSelection.contents = text;
// For group items, iterate through each group item and recursive call this function.
} else if (thisSelection.typename == "GroupItem") {
// Change the text items within this level of the group
for(var k=0; k < thisSelection.textFrames.length; k++){
ChangeElement(thisSelection.textFrames[k],text);
}

// Now recursively process the group items within this group
for(var j=0; j < thisSelection.groupItems.length; j++){
ChangeElement(thisSelection.groupItems[j],text);
}
}
}

ChangeTextContents();

10% popularity Vote Up Vote Down


 

@Sims5801359

You can use this short little snippet of a script:
#target illustrator
function ChangeTextContents(){
if(app.documents.length > 0 && app.documents[0].selection != null){
var newText = prompt("Enter new text:", "");
if(newText != null){
var sel = app.activeDocument.selection;
for(var i=0; i<sel.length; i++){
var s = sel[i];
if(s.typename == "TextFrame"){
s.contents = newText;
}
};
}
}
}
ChangeTextContents();


It will simply put your input text into the text frames that you will need to have in a selection.

10% popularity Vote Up Vote Down


 

@Courtney577

You can dynamically load text into Illustrator using an XML file.


Using the Variables panel, you can import an XML file and use that to
control the existence of objects, what images appear in linked image
containers, and what text appears in a text frame. You can also
control the data that appears in a graph. The typical workflow is to
create a template document and then tag it for variables.


There are multiple tutorials online discussing how to do this. This article: HOW TO USE ADOBE ILLUSTRATOR VARIABLE DATA WITH XML has a good video and step by step tutorial on how to do this.

Or you can do either of the following:

1) Delete the second text box. Make the text change. Copy -> paste text and apply the font or character style.

or

2) Just copy the text and paste into the other text box after finishing editing the first text box.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme