Oh Sorry cut & paste error,
//Correct snipet in try/catch block is
I have found that making the frame that you want to link to the current selection woks.
set previous text frame of selection to myNewTextFrame
Hope that helps.
Can you be more elaborative?
In this context, both previousTextFrame and nextTextFrame are user-defined variables. I bet you actually wanted to set properties of myTextFrame:
myTextFrame.previousTextFrame = myPreviousPage.textFrames.itemByName("main");
myTextFrame.nextTextFrame = myNextPage.textFrames.itemByName("main");
And you are bang on target Jongware.
I remember I tried something like before but with error (in syntax ) seems to be.
Secondly how can I ensure that no text from previous textframe or next textframe is get flowed to this "my" dummy frame though threaded. I guess applying textwrap or transparency will suffice.
You want to link a text frame between others but you don't want to have the text flow through it? ... Why?
(What I mean is, you may have perfectly good reasons for this, but if you don't want the text threaded into the new frame, just don't set the previous/next frames ...)
>but if you don't want the text threaded into the new frame, just don't set the previous/next frames ...
I understand what exactly do you mean with it and what are the risks. Though this may be not the best approach, but I thought of testing it and will try to explain.
I am working on final documents, where in I need to insert few informations (like page break, informations of floats as per their appearance in document, this could be on top of page (Single/Double Column), bottom of the page, at bottom of column (S/C), bottom of second column etc etc.)
Just to let you know that this is an XML project and roundtripping of XML will require. All normal text flows on textFrames of pages labelled "main" except the floats, which obviously placed on their respective frames with some unique label.
Everything goes well with my script except on pages where the "main" textframes are missing (usually full page Arts/table floats). Ideally they ("main" textFrames) should not be touched and should lie beneath the float rectangles but I've seen the cases, where comps are intentionally deleting them => placing float items on these particular pages. While attempting this they skip the thread on float page and continue it on next page (Disaster ---
Since, the "main" textframe on float frame has been removed and I am required to insert the information of that particular float on that page I am adding a dummy frame with same label to add the information threading it to previous and nextTextFrame while ensuring no text has been flown to my dummy frame. This ensures to have the piece of infos inserting with roundtripping. (NOTE: All these infos are applied to special character style so that text on pages remains intact).
I tried to insert infos for such cases in previous or nexttextframes (pages), but I literally struggled with syntax and decided on this as I can control the flow of text. Still in testing phase so not sure whether I will be keeping this approach or not.
I hope I made myself clear. I am writing this script for some horrible Indesign output with XML. Already tired of defining conditions. :-)
Okay, I got it (I think ).
I agree: usually, when I have a full page graphic, I apply a text wrap but leave the original threaded frame below it, but I found that it doesn't play nice with footnotes, as well as a couple of other borderline cases. So whenever it causes problems I delete the threaded frame.
Perhaps you can add your text frame and then immediately add an invisible graphics frame on top of it with Text Wrap enabled. Of course this might create an entirely new problem if your full page graphic has a caption ...
>Of course this might create an entirely new problem if your full page graphic has a caption
In most of the instances this is the case only, I mean graphic with caption. Apart from it there are full page tables cases or even table continuing on multiple pages.
So I don't know, I am still sticking to this approach at least till the testing phase and let's see how it goes later. Any suggestions in this regard will be great.
Highly appreciated for your time.
You can make your text frame really small (too small for text to flow into it).
Another option would be to make the indent almost equal to half the size of the text frame (again this does not leave room for the text...)
Oooh -- nasty!
Thinking about it, you can also set the frame text insets left and right to half the frame width ...
Glad you like!
Yeah. "indent" should have been "inset"...
>frame text insets left and right to half the frame width
This will be real tricky. :-)
Thanks Harbs and Jongware.