Skip to main content
Participant
April 5, 2013
Answered

Moving frames upstream or downstream

  • April 5, 2013
  • 1 reply
  • 956 views

I'm new to InDesign scripting. Is it possible to programmatically move text frames upstream or downstream? My understanding is that numbered paragraphs are numbered by frame/story, not by order on the page. If I create a text frame after the document is set, I want to move that frame "upstream" so it is numbered before the main story. Is this an attribute I can change in a script? If so, what's the keyword I should be looking for when I dive in?

Thanks so much!

Aaron

This topic has been closed for replies.
Correct answer Trevor:

Hi Aaron,

If your are talking about linked frames you can set the nextTextFrame and previousTextFrame properties

If you are talking about non linked frames (which I think you are) then you can just use

myFrame.bringForward () and myFrame.sendBackward () or

bringToFront ([reference: PageItem])

or myFrame.sendToBack ([reference: PageItem])

Even if you were to cut and paste you would just use app.cut() and app.pasteInPlace() in the same document, but obviously the above method is better.

Trevor

1 reply

TᴀW
Legend
April 7, 2013

Hi Aaron,

Your question isn't very clear. What do you mean by "upstream" and

"downstream"? What do you call a "numbered paragraph"? What do you mean

by a text frame which is "numbered" before the main story?

Could you elaborate?

Thanks,

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
AaronCAAuthor
Participant
April 7, 2013

Numbered paragraph = a paragraph style that includes numbering (e.g., figure/table captions).

Upstream/downstream is the terminology used in the InDesign documentation when talking about the order in which frames were created (i.e., earlier frames are upstream of later frames).

The way numbering apparently works in InDesign is that numbers are generated on a story-by-story basis. Placement on the page is irrelevant. What matters is when each frame was created. So if I have a book chapter containing 4 captions and I want to extract the first one and put it in an un-anchored text frame, it will number that first caption as 4, not 1. InDesign numbers everything in the main story first and then each frame afterwards in date-created order.

What I want to know is if that "date-created" attribute can be modified programmatically. As it is, if I want to change the order of my floats, I have to cut them all into a separate document and paste them back in in the correct order. (So frustrating. Even Word gets this aspect of numbering right!)

I appreciate your time.

Aaron

Trevor:
Trevor:Correct answer
Legend
April 8, 2013

Hi Aaron,

If your are talking about linked frames you can set the nextTextFrame and previousTextFrame properties

If you are talking about non linked frames (which I think you are) then you can just use

myFrame.bringForward () and myFrame.sendBackward () or

bringToFront ([reference: PageItem])

or myFrame.sendToBack ([reference: PageItem])

Even if you were to cut and paste you would just use app.cut() and app.pasteInPlace() in the same document, but obviously the above method is better.

Trevor