[ID 5.5, JS] Blocks of text or program group of the United Nations in document

I have a document of several hundred pages (ID 5.5, JS). I need to put new coordinates for the linked text frames. It works fine as long as there is only a single textframe by page. Here's my code:


var myDoc.textFrames = monarticle;
for (var i = 0; i < myStory.length; i ++) {}
var myPage = monarticle [i];
myPage.geometricBounds = [30,23.5,267,186.5]


Of course, this does not work for pages where I have several textframe. My theoretical approach is first group these and then set the new coordinates for executives of group related texts, and after the work is done, dissociate the.


I found the following script by Tomaxxi which works fine for the active page, but I need the job done for the whole document.

var myObj = new Array; myObj = app.activeWindow.activePage.pageItems; app.activeWindow.activePage.groups.add(myObj);

After some fruitless effort I must admit I have no idea how to adapt it to my specific needs. Any help is much appreciated.



Hello Pia,

I have checkd your condition in the code js John.

I just changed your more than 1 select elements

var myDoc = app.activeDocument;
var i, myObj = [];
for (i=myDoc.pages.length-1; i>=0; i--) {
  myObj = myDoc.pages[i].pageItems;
  if(myObj.length >1){
       myDoc.pages[i].groups.add(myObj);
       }
}

THX

csm_phil

Tags: InDesign

Similar Questions

  • After separate or unscrew the last block of text, it still points to the old story

    Hello

    I used "kTextUnlinkCmdBoss" to separate the last block of text on the wire, however, once the order is processed, if I have access to the textModel of the box following it still points to the old model:

    InterfacePtr<IGeometry> srcgeometry (srcbox,UseDefaultIID());

    If(srcgeometry ==NULL) break;

    InterfacePtr<IMultiColumnTextFrame> srctextframe(srcbox. ) GetDataBase (), Utils<IFrameUtils>-> ()GetTextFrameUID(srcgeometry), UseDefaultIID());

    If(srctextframe ==NULL) break;

    Srctextmodel InterfacePtr<ITextModel> (srctextframe->QueryTextModel());

    If(srctextmodel ==NULL) break;

    Is it possible to force a refresh the news of textModel in relation to the text block? Of course, if I checked the textModel later, he is properly affected by a new, it's just problem of info is not refreshed on the same running cycle.
    Thank you
    ADI

    Hi Adam, Hi Dirk,

    what works for me using kTextLinkCmdBoss on the precceeding box.

    InterfacePtr iTextLinkCmd (CmdUtils::CreateCommand (kTextLinkCmdBoss));

    UIDList uidList (iDataBase);

    uidList.Append (mcTextFrameUID_preceeding);

    uidList.Append (mcTextFrameUID_preceeding);

    iTextLinkCmd-> SetItemList (uidList);

    CmdUtils::ProcessCommand (textLinkCmd);

    Best,

    Peter

  • Not able to be seen on top of an image with no text wrapping, prepared text box to be on the top, on the top layer and works fine with all other images with text is near or above the image in this document, PLEASE HELP

    I have an InDesign Document with a handful of images and text on the top or near the images. This should be so simple, but for some reason, I keep having this problem. There is no build-up on the given word and I can't place any text on one of the images. All the settings for all of the images in this scenario are the same. I'm fine with everything else but this one...

    I don't see any boxes hidden or anything else for that matter. I've recreated text boxes and still have the same problem it appears then disappears or I can get only part of the Word visible on the image, then a + sign comes... It should work please help. I tried to recrete this particular image and word a handful of times its just not the text box woking sometimes added a sign which does no sense, I tried a different text alignment so +... Yes indeed HELP Please thank you I can send a screen if it helps

    Have you tried select the text block, and then go to object > text frame Options and checking the checkbox ignore text dressed ?

  • I'm filling out a form that is available on a site. When I click on the option to fill out and submit the form 'online' a pdf document is displayed in chrome with the following text "to display all of the content of this document, you need a later version

    I'm filling out a form that is available on a site. When I click on the option to fill out and submit the form 'online' a pdf document is displayed in chrome with the following text

    «To display all of the content of this document, you need a later version the viewer PDF.» You can upgrade to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html for further support, go to www.adobe.com/support/products/acrreader.html"

    Needless to day, I installed the latest version. I even reinstalled using the link in the message, but nothing helped. Whenever I click on the link to go forward, I get the same message. Question: (i) is it my PC/software (Vista), (ii) is the site where I'm trying to submit the form, or (iii) is it the software acrobat reader. Note that I used successfully the last version to fill out and sign forms.

    It is none of them. It's Chrome, which is ignoring Adobe Reader and showing the message.

    Solution: just save the document (with the message) to your desktop. Then open it in Adobe Reader. The 'real' should then display.

  • Place a block of text in small characters outside the margin

    Is there a method by which I could place a block of small text (outside the margin) in all of the main text and every time the body of the text moves, the small text block also moves along with the main text block? I work with the laws of Parliament and along the main text, there are a lot of marginal notes, which must be placed. Unfortunately, I have to put the marginal notes manually and whenever the text of the law is changed, I have to re - align all marginal notes manually. PageMaker has a solution, you know? Thank you.

    lawproject wrote:

    Is there a method by which I could place a block of small text (outside the margin) in all of the main text and every time the body of the text moves, the small text block also moves along with the main text block? I work with the laws of Parliament and along the main text, there are a lot of marginal notes, which must be placed. Unfortunately, I have to put the marginal notes manually and whenever the text of the law is changed, I have to re - align all marginal notes manually. PageMaker has a solution, you know? Thank you.

    I think you can do this in Indesign with a block of anchor text.

    Jay

  • Block of text not threaded connection to the linked text frames

    Can someone please help with a script js (for ID 5.5) that connects a textframe not threaded to those threaded. I tried

    myTextFrameA.nextTextFrame = myTextFrameB;

    He messes things as soon as I learned to link more than once, of course, I have to (I need a script otherwise?).

    Thanks for your help.

    Oops - I did not try before posting. The idea was to force the script to stop when you have selected something else, and in general a 'return' is sufficient.

    Change the 'back' in 'exit (0)' he'll grind to stop as required.

  • Adding pages and blocks of text to emulate the behavior of "Smart Text Reflow"

    I create a large number of tables in a document.  If I'm Smart Text reflow on, my script is malfunctioning.  I have the start of treatment:

    1. Add a new table

    2. If the last block of text of page overflowing and then add a new page

    With smartTextReflow off, I want to assure that the executives of new blocks of text which corresponding to the main text of the page master.  It must be able to manage to get the settings from the page of left/right text block.

    I have solved my problem.  I was overthinking things!

    Given that I have selected blocks of text on master pages as the main text blocks, when you create a new page, a block of text is automatically created. So the problem is then simply connect the block preceding text for the text block that was created when the page is added.

    TableAutomation.prototype.AddPage = function() {
         var previousTextFrame = app.activeDocument.pages[-2].textFrames[0];
         var np = app.activeDocument.pages.add();
         var textFrame = np.textFrames[0];
         previousTextFrame.nextTextFrame = textFrame;
    };
    

    The cost of the above code was about 5 hours of banging my head against the wall

  • Blocks of text on the Pages of body 'Buried' after update of the Page Master

    I have a background full screen on my main page (on the left in this case) that integrates static graphics and borders for certain master pages. I use the borders/boxes for NOTE and END of text on some pages. Blocks of text on these master pages do not overlap. I added text blocks with my icons and the text of the note to these body Pages that I need them. All great so far.

    I decided to update the background chart on page master to change colors, etc.. All files are linked.

    Now, with funds master page updated, these pages where I added text blocks are 'buried' as on a sublayer. I checked that my Master Page background images are "sent back". I tried to wear my text boxes at the front on the Pages of my body, but they are still hidden. Interesting as the anchored frame (the icon), I attached to each NOTE or TIP point appears, but the text is not. Also, I can see and select the contours of the block... the text is hidden. If I drag the fame to another part of the document (for example, on top of another Master Page text frame sank, while the text is displayed.

    There is no image on the master page to the enclosed area. I wonder if that's what I need trouble. Just add a backstory (not attached flow)?

    Advice before I go and screw something else?

    It is what it is supposed to look like (1). Image (2) what I mean now.

    V7Page2.jpg

    V7Page.jpg

    Thanks Arnis,

    It was the property of skin! How simple... I didn't have on this subject.

    Solved!

    To answer you question, however... my approach for the construction of this new model was:

    1. I created a graph from bottom (full page) to contain the image of brand and imported/positioned.
    2. I placed the header and a footer frame and filled with content.
    3. I placed the blocks of text with streams (as a single stream in this document).

    I'm not dropping blocks of text for the content of the body... except for these tips and remarks. I don't want to use a workflow for this because I never know where they'll pop up and I want to be able to (position) specifically on each page. Is this a good approach?

    Yes, I'm aware of the continuous line down the block of text NOTE you mentioned. Originally, I had all the text within the limits. When I have updated master, all offbeat pages (only in blocks of text body page with notes/tips). I repositioned and they flow very well now.

    Thank you very much for your help continues with it. Why these problems always pop nitpciky - up to date - not when things are slow!

  • Copy blocks of text between documents

    I have two documents which have the same number of pages. I want to write a script to copy blocks of text on each page of the document source to the corresponding page in the target document. There is usually only a single block of text on each page, and I want it placed exactly the same in the target as the source. I tried the following:

    for (var i = 0; i < fromDoc.pages.length; i ++) {}

    for (var j = 0; j < fromDoc.pages [i].textFrames.length; j ++) {}

    var fromTextFrame = fromDoc.pages [i] .textFrames [j];

    App.Select (fromTextFrame);

    App.Copy ();

    toPage var = toDoc.pages [i];

    App.Select (toPage);

    App.Paste ();

    }

    }

    It gives me an error on the statement of app.copy: "Cannot copy/cut because of invalid selection."

    Can someone help me with the right code? That the ks!

    Sorry - it's a bug in the forum software that is sometimes

    submitted by email do not appear. What I said is:

    You should avoid the use of copy(), paste() etc. - There is almost always a

    best way to do things.

    In this case, see the duplicate of a textFrame method:

    TextFrame.duplicate (for: varies by: table of unit of measure (number or))

    String)): PageItem

    Adobe InDesign CS6 (8,0) Object Model

    Duplicates the TextFrame to the location specified or offset.

    of: Data Type: varies

    The location of the new TextFrame, in coordinates specified in the

    format. Can accept: table of 2 units, spread, Page or layer.

    (Optional)

    by: Data Type: table of unit of measure (number or string)

    Amount to compensate for the new original TextFrame

    TextFrame position. (Optional)

    You can see that the setting 'to' duplicate() accepts various

    things, which seems to be what you are looking for: page.

    So if you set myPage to a page in a second document, likely to be you

    will find that it has been reproduced on this page:

    myTextFrame.duplicate (myPage)

    Try and see how the text block lands facing upward.

    If this isn't in the right place, I suggest to copy the

    the source for the new textFrame textFrame geometricBounds (he can be)

    have other ways to do it). Just ensure that the origin of the rule and

    units of measure in the two documents are the same.

    HTH,

    Ariel

  • by selecting all the blocks of text on all visible layers

    I want to select all the blocks of text on all visible layers.

    the script below will select all the blocks of text, even in groups, but if the layer with the text is invisible the script error. (target layer cannot be changed)

    If (app.documents.length > 0) {}

    var doc = app.activeDocument;

    var numTextFrames = 0;

    for (i = 0; i < doc.textFrames.length; i ++) {}

    textArtRange = doc.textFrames [i];

    textArtRange.selected = true;

    }

    }

    So I made this script to select blocks of text on only visible layers, but now missing text belonging to a group.

    var layerCount = activeDocument.layers.length;

    var docSelected = activeDocument.selection;

    for (i = 0; i < layerCount; i ++)

    {

    currentLayer = activeDocument.layers [i];

    If (currentLayer.visible == visible)

    {

    for (j = 0; j < currentLayer.textFrames.length; j ++) {}

    textArtRange = currentLayer.textFrames [j];

    textArtRange.selected = true;

    }

    }

    }

    can someone tell me why it is not some frames of text bound in a group when made this way and is it possible to get all managers of related texts selected on all visible layers?

    Thank you

    Duane

    Try this:

    if (app.documents.length > 0 ) {
        var doc = app.activeDocument;
        var numTextFrames = 0;
        for (  i = 0; i < doc.textFrames.length; i++ ) {
            try {
            textArtRange = doc.textFrames[i];
            textArtRange.selected = true;
            } catch (e) {}
            }
        }
    

    Have fun

  • Adding blocks of text

    I add blocks of text via a script to each layer of each broadcast of a file.

    The only properties that I speak are the geometric limits and the outline color and size.

    On some client provided files if I run another script to tell me the geometric limits of managers of related texts, on some pages it shows the first two geometric as limits being-. 0 and 999999999999 when she's been assigned to-1 and 0.  But if I manually click on the blocks of text, they are properly showing the y of x that I coordinate expect (-1, 0).

    I'll try to post the code a little, but I'm sure this has more to do with the files from the front pages to no and it leaves a persistent problem. Maybe I need to wipe completely all of the properties in pages face before adding blocks of text?

    Converting the value at the front is not necessary, ID done this on its own.

    Curiously, a conversion from inches to points * is * accurate--a thumb is equal to 72 points. Or at least it does if you use definition of Adobe (which I believe that indesign uses internally).

    I would just not worth on inconsistency 0.00000001%. Even if your output will be furred, should be miles (or kilometres ;)) scale before someone should she notices, and at these magnifications the process itself would add many more potential inaccuracies.)

    If you want to display the value of a user, use the flare:

    valRounded = Math.round(value*1000)/1000;

    will return your value with a modest three digits of precision.

  • How can I move a block of text from the head of <>tag area within the &lt; body &gt; tag box?

    I am retarget approximately 2500 html files and a block of text should be moved to the head of <>mark the surface of the < body > tag. It must immediately follow the < body > tag. Here is an example: < h3 > heading < / h3 > < p > A bunch of text here, blah blah < /p >.  I find the block using a regular expression < >(.*?) < p > h3, but do not know what to do after that.

    If you just want to move the

    and

    on theand in thethe following regular expression work:

    (

    [\s\S]*?

    )([\s\S]*))

    Replace in the field, use this:

    $2$ 1

  • SpellUI Feature request: processing the change of words in the middle of a block of text improved

    I use Squiggly 0.5, Flex 3.5, using AdobeSpellingUI.swc.  It seems that when a text box is analyzed on a CHANGE event, SpellUI will not be considered the last word, regardless of where is the location of the cursor.  that translates into two odd behavior:

    (1) when you type a word in the middle of a block of text, Squiggly underlines each partial word until the word is correct (for example when typing "basketball", "basketba" gets highlighted)

    (2) when you type a word in the middle of a block of text, a misspelled word in the end does not get stressed.

    Desired behavior: rather than coverage by ignoring the last token, ignore the token before the selectionBeginIndex/anchorIndex

    Hi Brad,

    Many thanks for this note. We checked. We are working on this issue and seeks to integrate the fix in future releases.

    Concerning

    Matthis

  • Cannot create a new paragraph in a block of text

    User of Windows 7, 64-bit machine... ALienware i7 processer.

    I create blocks of text and you can type the first paragraph very well. When I type entry to add my second paragraph my cursor disappears. If I type it shows more red overset text.

    I checked my space, my paragraph spacing after...

    Tried many documents... PLEASE HELP ME

    Edition > shortcuts keyboard... and make a new set because you can't change the game by default.

    In the product box, select Menu Type and scroll to the bottom to insert a character to break: paragraph return and select it. Now, place the cursor in the new shortcut field and press enter on the numeric keypad. Context of you changing text, then click on assign, then OK.

  • Apply the paragraph style instead of runned text simply by clicking on the text box

    I'm changing the style of the text entity. Is there another way to change it to select all the text, and then set the style?

    Capture.JPG

    IT is threaded text block (not a box!) you have to select all the blocks of text at a time in the thread (which is impossible if they are on different spreads) or you must select all of the text to apply a style.

    If the text block is not passed, you can select and apply the text.

    I do not see a problem to select all the text. Use the text tool, click in the text and the cmd/ctrl + A and apply the style. Not a problem, not a lot of work.

    A box is something like BleedBox, CropBox or something like that. Objects in InDesign are still frames or paths.

Maybe you are looking for