Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Selected text box, new text box with used font name

Engaged ,
Mar 18, 2020 Mar 18, 2020

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
1.0K
Translate
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
...
Translate
Adobe
Advocate ,
Mar 18, 2020 Mar 18, 2020

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.

Translate
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

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

It is working perfectly!!

Thank you, Carlos

Translate
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
LATEST

awesome!!

Translate
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