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

Hyperlinks hierarchy

Community Expert ,
Aug 01, 2023 Aug 01, 2023

Copy link to clipboard

Copied

Am I missing something or it's another bug / poor design ?

 

When building a list / tree of Hyperlinks - HyperlinkExternalPageDestination, HyperlinkPageDestination, HyperlinkPageItemSource, HyperlinkTextDestination, HyperlinkTextSource, HyperlinkURLDestination - ALL of them have a Parent = Document - instead of a Hyperlink ? Why ??

 

Also, for some Hyperlinks, their Source or Destination returns error "Type Mismatch" when reading info (in VB) - even when in the DebugMode the Type is "TextStyleRange" AND is accessible when debugging AND ShowSource() / ShowDestination() works ??

Thought it's a damaged file and done IDMLing - but it didn't help.

And it's only for a few HyperlinkTextDestination, HyperlinkTextSource - in the file I have - but they look "normal" otherwise.

 

Can't share source INDD file but if someone have some idea for JS code for testing - would be great.

 

TOPICS
Scripting

Views

177
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 ,
Aug 01, 2023 Aug 01, 2023

Copy link to clipboard

Copied

All those hyperlink objects are children of the document. 

 

s = doc.hyperlinkTextSources.add();

d = doc.hyperlinkTextDestinations.add();

doc.hyperlinks.add (s, d);

 

That text source and text destination are used as parameters in the hyperlinks.add() function doesn't make them its children. They're all at the same level (or, to maintain the analogy, the same generation).

 

Can't share source INDD file

 

Without the problem file there's not much we can say about the problem.

Votes

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 ,
Aug 01, 2023 Aug 01, 2023

Copy link to clipboard

Copied

Now that you mention it - I can understand why Destination can't have a parent - as it can be a destination for multiple Hyperlinks.

 

But Source - can't be used in multiple Hyperlinks... Or can it?? 

 

I can build the tree from the Hyperlinks collection - but Source / Destination isn't always a HypetlinkSource / HyperlinkDestination - can be text directly, etc. - just thought it would be quicker / easier to do it from the childrens side - but as already determined - Destination can have many "starting points". 

 

Votes

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 ,
Aug 01, 2023 Aug 01, 2023

Copy link to clipboard

Copied

But Source - can't be used in multiple Hyperlinks... Or can it?? 

 

Well, no, because that wouldn't make any sense. If you if you create a hyperlink on a single word, it can point to only a single destination.

 

I needed to be able to go forward and backward, to create a chain of links, so to speak. That was possible by setting a source on the first half of the word and another source, pointing to a different destination, on the second half.

Votes

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 ,
Aug 04, 2023 Aug 04, 2023

Copy link to clipboard

Copied

Almost done and dusted.

 

This is a hierarchy by Parent -> Child - column TYPE:

RobertTkaczyk_0-1691173896805.png

 

And this is just sorted by ID:

RobertTkaczyk_1-1691173927356.png

 

which shows how many times each Destination is referenced - in this case HLDestination with ID=3949 (it's not visible here but each row have a hidden reference to the Parent for quick and easy access if necesssary).

 

Still need to add the rest of Hyperlink types.

 

Votes

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 ,
Aug 05, 2023 Aug 05, 2023

Copy link to clipboard

Copied

LATEST

All possible Hyperlinks and Bookmarks combined. 

Hyperlinks_1.png

 

Top is displayed by hierarchy - bottom by ID so it's possible to see how many times particular destination is referred to. 

 

Votes

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