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

How to select Point Type Object by name in Javascript?

LEGEND ,
Nov 18, 2018 Nov 18, 2018

I'm sure this is easy but I'm not getting something right. I want to select a "Point" type text object in Javascript. How do I do that? Here's what one thing I've tried. I get the message "undefined is not an object".

var myDoc = app.activeDocument;

myDoc.TextFrameItems.getByName ("CoordinatesText").selected = true;

TOPICS
Scripting
761
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 , Nov 18, 2018 Nov 18, 2018

Hi Ray, the Reference is incorrect, it should be textFrames

myDoc.textFrames.getByName ("CoordinatesText").selected = true;

Translate
Adobe
Community Expert ,
Nov 18, 2018 Nov 18, 2018

Hi Ray, the Reference is incorrect, it should be textFrames

myDoc.textFrames.getByName ("CoordinatesText").selected = true;

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
LEGEND ,
Nov 18, 2018 Nov 18, 2018

That did it. Thanks so much, 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 ,
Nov 19, 2018 Nov 19, 2018
LATEST

rcraighead  schrieb

… select a "Point" type text object …

only for the sake of completeness

var myDoc = app.activeDocument;

var aTF = myDoc.textFrames.getByName ("CoordinatesText");

if (aTF.kind == "TextType.POINTTEXT") {

    aTF.selected = true;

    }

Have fun

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