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

add a textFrame to a specific layer?

Engaged ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

I am adding text to my document with the following parameters setup...

var attachmentTextFrame = doc.textFrames.add();

// Fill color

attachmentTextFrame.textRange.characterAttributes.fillColor = newRGBColor;

// Font size

attachmentTextFrame.textRange.characterAttributes.size = 14;

// Font

attachmentTextFrame.textRange.characterAttributes.textFont = app.textFonts.getByName("Arial-BoldMT");

// Make all text uppercase

attachmentTextFrame.contents = attachmentDescription.text.toUpperCase();

// Placement of the textFrame

attachmentTextFrame.position = new Point(useThisX, useThisY);

Is there a way to make this textFrame be created on a layer called "Single Line"?

TOPICS
Scripting

Views

1.9K

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 , Nov 21, 2017 Nov 21, 2017

attachmentTextFrame.moveToBeginning(app.activeDocument.layers["Single Line"]);

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

attachmentTextFrame.moveToBeginning(app.activeDocument.layers["Single Line"]);

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 ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

well that was quick and easy. lol. thank you williamadowling​!

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 ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

You got it, brother.

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 ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

williamadowling  schrieb

attachmentTextFrame.moveToBeginning(app.activeDocument.layers["Single Line"]);

Only one question: why moving after creation instead of creating directly at destination layer?

var attachmentTextFrame = doc.layers["Single Line"].textFrames.add();

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
Explorer ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

LATEST

Good point. I will update the script to do that. Much appreciated! I learn so much from everyone on this forum!

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