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

Pendant to document.getElementById

New Here ,
Dec 06, 2011 Dec 06, 2011

Copy link to clipboard

Copied

Hi,

sorry, I'm just starting learning FrameMaker ExtendScript, but I'm still stucking at the basics. I googled a lot, used the FM10 scripting guide, and so on but I didn't find a low-level tutorial for users like me, so I'd be glad, if you'd help me by answering some - hopefully - simple questions:

  • Is there a pendant to document.getElementById which returns a reference to an element by its ID in JavaScript.
  • (How) can I catch the parent XML element of an anchored graphic, if I grab the graphic element with FirstGrapicInDoc?

Sorry, I know asking questions that way isn't very welcome. But I'd be very glad, if you'd answer them anyway. I'm keen on writing a beginners tutorial for technical writers with basic XHTML+JavaScript skills.

Thanks a lot

Stefan

TOPICS
Scripting

Views

994

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
Guest
Dec 06, 2011 Dec 06, 2011

Copy link to clipboard

Copied

Hi, Stefan,

There is not a direct analogue to the document.getElementById function because FrameMaker's document/object model is so fundamentally different than the HTML DOM. Depending on that you are trying to do, you would likely end up using doc.Find() for the relevant attribute/value pair. In a few circumstances, doc.getUniqueObject() might also be appropriate.

I have very limited experience moving XML into and out of Frame, so I'm feeling a bit speculative about your second question, but the first thing I would try would be myGraphic.FrameParent.Element.

For an introduction to many basic concepts, including the FM document model, I highly recommend Debra Herman's blog, Extending Framemaker.

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 ,
Dec 06, 2011 Dec 06, 2011

Copy link to clipboard

Copied

LATEST

Hi Stefan,

  1. If you trying to get an element based on @ID, there is no direct way.
  2. For an anchored graphic object (say, gph), you can get the parent XML element using - gph.Element.ParentElement.

Regards,

Tarun Garg

Adobe FrameMaker Engineering

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