Skip to main content
May 10, 2022
Question

Finding out the ObjectID of elements to create links in FM2019

  • May 10, 2022
  • 2 replies
  • 187 views

Hi there,

 

I'm trying to create a link in FM2019 so that when it is clicked, it will go to a specified element in a page (for example, a table or image). I am using the "hypertext" pod to create the aforementioned link, since I would rather not create a cross-reference link in this instance. 

 

Under the "command" dropdown panel in the hypertext pod, I have been successful in creating a link using the "go to specified page" command (e.g.: "gotopage 00/01:58", i.e. filename + page number). This is effective for linking to the start of a page, but as mentioned above, if I want a link to go to an element halfway down a page it appears I'll need to find the objectID to link to. 

 

Would anyone be able able to tell me where I can find the objectID of elements, else a way I can create links to certain elements within a FM2019 project using the hypertext pod? 

 

Any assistance would be much appreciated.

    This topic has been closed for replies.

    2 replies

    Bob_Niland
    Community Expert
    Community Expert
    May 10, 2022

    And to constrain the the reply space, do you need these deep links to work only intra-document (same document), or do you need them to work inter-document (to separate documents)? The latter requirement exposes more challenges.

    frameexpert
    Community Expert
    Community Expert
    May 10, 2022

    File names and paths in the markers are relative (not absolute) so they are not usually much of a problem.

    frameexpert
    Community Expert
    Community Expert
    May 10, 2022

    To link to a certain location, you can put a Hypertext marker at that location with a "newlink" named destination. Then you can create a link to that location using a Hypertext marker with "gotolink" or "openlink" syntax.

     

    If you want to avoid the "newlink" destination marker, you can use the same syntax that is used by FrameMaker generated lists. For example, I just generated a list of title elements and here is an example entry:

     

    openObjectId SPEC-18A.fm:5 3035275

     

    After the filename and colon are two numbers; in this case, the 5 indicates that I am pointing to an element and the 7-digit number is the Unique property of the element. To build these kinds of links, you need to know the hidden Unique property of the element (or paragraph, or whatever you are pointing to). Here is a piece of ExtendScript code that you can use to identify the Unique property of the selected element:

    #target framemaker
    
    var doc, element;
    
    doc = app.ActiveDoc;
    element = doc.ElementSelection.beg.child;
    
    alert (element.Unique);

    Save this chunk of code in a plain text file, select your target element, and choose File > Script > Run to run the script. It will display the required target number for your marker.

    May 12, 2022

    Thanks for the help, and I appologize for the late reply! I'll give your suggestions a try.