• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Selected text box, new text box with used font name

Engaged ,
Mar 18, 2020 Mar 18, 2020

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

Image-2020-03-18-12-44-ps

TOPICS
Scripting

Views

793

Translate

Translate

Report

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 18, 2020 Mar 18, 2020

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
...

Votes

Translate

Translate
Adobe
Advocate ,
Mar 18, 2020 Mar 18, 2020

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.

Votes

Translate

Translate

Report

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 18, 2020 Mar 18, 2020

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();

Votes

Translate

Translate

Report

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
Engaged ,
Mar 18, 2020 Mar 18, 2020

Copy link to clipboard

Copied

It is working perfectly!!

Thank you, Carlos

Votes

Translate

Translate

Report

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 19, 2020 Mar 19, 2020

Copy link to clipboard

Copied

LATEST

awesome!!

Votes

Translate

Translate

Report

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