Scribusoid

Author Topic: How to follow the link chain?  (Read 501 times)

michaelu

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
  • Scribus User
How to follow the link chain?
« on: November 11, 2019, 09:44:53 am »
Is there a function to get the textframe links, i.e. if frame A is linked to frame B, can I call something like getLinks(A) and get B back?
Are links 1:1 or 1:n? I suppose A may have only one link, but B may be the target of more than one frame?

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2253
  • Karma: 28
    • the graphics lab
Re: How to follow the link chain?
« Reply #1 on: November 11, 2019, 10:02:46 am »
hi michael

2. links are 1:1 (that was easy)

1. i'm not aware of a way for checking the relationship between a text frame and a chain of text frames.
   the exportAllText solves this (not really gracefully) by putting all the text in an array and checking if the "getAllText" in the current item is already in the list of contents.

it would be good if the API could be enhanced with a way to detect chains of texts.

i guess that the two functions

- getNextInChain() and
- getPreviousInChain()

returning the name of an item or Null would be what we need...

if you want to work on that i can look for the relevant parts in the scribus code...