Copy link to clipboard
Copied
Hi!
I have a document with some text boxes, all have same text, each one different font.
I would like to create at the side of each selected text box a new one with the name of the font
Any ideas how i can do it?
Panagiotis
1 Correct answer
select your text frames and try this script
// add selection text font
// carlos canto - 03/18/2020
// https://community.adobe.com/t5/illustrator/selected-text-box-new-text-box-with-used-font-name/td-p/10988655?page=1
function main() {
var idoc = app.activeDocument;
var sel = idoc.selection;
var dup, t, spacing = 40;
for (var a=0; a<sel.length; a++) {
f = sel[a];
dup = idoc.textFrames.add();
dup.contents = f.textRange.characterAttributes.textF
...
Explore related tutorials & articles
Copy link to clipboard
Copied
I would suggest splitting the font name into its own text box so that as you copy each individual text box it retains the font name specs. If you don't want to have it within its own text box, then create a character style that you can apply to the font name.
Copy link to clipboard
Copied
select your text frames and try this script
// add selection text font
// carlos canto - 03/18/2020
// https://community.adobe.com/t5/illustrator/selected-text-box-new-text-box-with-used-font-name/td-p/10988655?page=1
function main() {
var idoc = app.activeDocument;
var sel = idoc.selection;
var dup, t, spacing = 40;
for (var a=0; a<sel.length; a++) {
f = sel[a];
dup = idoc.textFrames.add();
dup.contents = f.textRange.characterAttributes.textFont.name;
dup.left = f.left + f.width + spacing;
dup.top = f.top;
}
}
main();
Copy link to clipboard
Copied
It is working perfectly!!
Thank you, Carlos
Copy link to clipboard
Copied
awesome!!
![](/skins/images/DAB90319B8FCC6914FB48BF3A053A8A8/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/DAB90319B8FCC6914FB48BF3A053A8A8/responsive_peak/images/icon_anonymous_message.png)