SE geometricBounds of a text insertion point [CS5 JavaScript]

The question arises to automated by placing an image on the exact location of the subsection that retains the reference to this image. The image should * not * be placed online. Even if I have a method to do this, I wonder if there is another cleaner way.

Text example:

paragraph of the story.

IMG001 < tab > this paragraph contains the name of the image and the caption.

following paragraph of the story.

I wrote a script that reads the mention of the image (the cursor is inside this paragraph) and the place of the image and the caption in a separate frame on the page.

To get the location of the paragraph that begins by * img I place a frame temporary small online at the beginning of this paragraph. Then I read the geometric limits of this inline frame, remove it and use these coordinates to place the frame of image on this vertical location.

The script works very well, but get the insertion of coordinates of the point seems a bit of a detour. Maybe it's the only way, but if anyone has a suggestion for a more orderly approach, I would be interested.

Insertionpoints have the horizontalOffset properties and the base, which are x, y coordinates.

Tags: InDesign

Similar Questions

  • Satellite C655 - text insert point is erratic, wandering and deletes

    I'm having an erratic text insertion point.
    When you use MS Word, WordPress or other trying to hit, the text insertion point jumps around while typing.
    The result is;

    (1) what I'm typing is inserted in the text that is already written,
    (2) text is placed elsewhere in the page, or
    (3) written text is deleted - this may be a word or a whole paragraph.
    Type it is like playing a game - type you and watch where the words are placed or erasure and always complete a sentence.

    I use a Satellite C655 which I bought through BJ, Word 7, Internet Explorer and Word Starter 2010.
    I don't like this version of Word, but my drive for Word 2003 does not install because of a "missing file" - go figure.
    It installed on my new Windows 7 desktop computer.

    Any suggestions? Is it a problem that I would return to my laptop for Toshiba?
    Since I'm a writer, this problem is serious for me.

    Dave
    [email protected]

    Hello

    If your laptop uses an older version of BIOS, please update the BIOS to the latest status.
    In addition, you must disable the touchpad while typing.
    In my case, I touched the touchpad accidentally area while typing and so my cursor jumped on another line

    Welcome them

  • Selection of the text insertion point

    I want to select all of the text between the insertion point to the end of the file. The instructions that I can find to this narration of shift + click. I insert the cursor in the text and hold down the SHIFT key and click on and nothing happens. Any suggestions?

    Shift + click selects all the text in the first position of cusror and the second click. To choose from anywhere at the end of a story, even if you don't see it, you can press Ctrl (Cmd) + SHIFT + END. You must select the text in each story separately if there is more than one story in the file.

  • Insert the list of names of link on the current page to the current text insertion point?

    Hello

    I need to automate the insertion of a list of the names of the links located on the page current / active to the blinker current text. (I forgot the technical name of the thing of blinking text line).

    Thank you!

    That would be "cursor" (apparently taken from Latin, 'Messenger', not a person who cursed a lot).

    This javascript does the trick. He first tries to determine the page, which is a bit awkward because the text blocks can be nested, on a master page, or on the pasteboard. If the script "does nothing, then closes" (quite a common mistake) or error, this would be a place likely to fail.

    If he has found its own page, it's a simple case of iterating over all the graphics on this page, which is fortunately a property 'Page '.

    theStoriesPage = app.selection[0].parentTextFrames[0];
    while (1)
    {
     theStoriesPage = theStoriesPage.parent;
     if (theStoriesPage.constructor.name == "Page")
      break;
     if (theStoriesPage.constructor.name == "Character")
      theStoriesPage = theStoriesPage.parentTextFrames[0];
     if (theStoriesPage.constructor.name == "Spread" || theStoriesPage.constructor.name == "MasterSpread")
      exit(0);
    }
    for (all=0; all		   
  • Just updated to Sierra and updated Pages at the same time. Now when I try to select a line of text I find myself with an insertion point where I stopped by selecting

    Today, I updated for Sierra and updated to the latest version of the Pages. Now I find that I am more able to select a line of text. When I try to do, I find myself with an insertion point where I stopped by selecting, but nothing is selected. This is a bug in the new version of pages or get my wrong settings?

    You use a Wacom tablet by chance?

    Solution: Press the shift key, just before stop selection. And Yes, that sounds like trouble in the Sierra.

  • Size of the text cursor (insertion point)?

    How can I control the size of the text cursor (insertion point)? The Windows setting in Accessability Options of the Panel seems to ignore Firefox.

    Try to create these two integer prefs:

    ui.caretWidth
    ui.caretBlinkTime (milliseconds;use 0 to disable blink)
    

    To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.

    If you see a warning then you can confirm that you want to access this page.

    • Use the filter at the top bar of the on: page config to more easily spot a preference.
    • Preferences that have changed also show "BOLD" (user set).
    • Preferences can be reset to the default value using the context menu if they are set of users
    • Preferences can be changed via the context menu: Edit (string or integer) or toggle (Boolean)
  • FOR FM10: add text at the insertion point

    Hello comrades,.

    What is the code for the current insertion point (where the cursor is placed currently?)

    I've seen code to add text at the beginning/end of FMP, but not at the current insertion point.

    Thank you in advance!

    Try using textLoc instead of TextLoc for your variable. TextLoc with this spelling is a reserved word.

  • AS: getting an integer from the object reference in the text to the insertion point

    I think the merger of data that I need a whole number of the insertion point. I have a practical object reference that says: 'text 78 to character... ". »

    I'm trying different ways to get this whole first, but everything the average back fail to transform into an integer. Brute force such as the constraint do not work. How to extract '78' of an object reference? Thanks, sam

    "Index of objRef.

  • [JS CS5] Access to an inline frame between an insertion point

    Given an insertion point, how can I determine if it contains a picture inline/embedded? And if so, how to reference the inline/anchored frame?

    I know how to reference the surrounding paragraph, characters, etc, but can't find out how to get to the graphic inline/anchored.

    I normally would just loop through all inserted graphics in the document, but it this case I have to access the incorporations through their insertion points.

    To reference the inline frame:

    prevChar.pageItems [0]

    or

    nextChar.pageItems [0];

  • Last insertion point of a line is ignored. Why?

    I am writing a script that takes a multiline paragraph and can scale down the pointSize to fit all the text on a line that corresponds to the width of the text block.

    Screen Shot 2013-08-27 at 12.33.55 PM.png

    Here's how to calculate.

    -J' add the length of each line to get the total width.

    -calculate the percentage of scaling by dipping the width of text to the total width frame.

    -several current point size with are.

    Pretty simple stuff.

    The issue I'm facing is that indesign makes the last character as the last point of insertion of each line. SHE IGNORES the SPACE AFTER IT. What shoul be technically the last point inseriton. So given that space cannot be calculated, it shake my whole scaling.

    Screen Shot 2013-08-27 at 12.34.09 PM.png

    I'm doing something wrong. Any help would be appreciated.

    my code:

    var frameWidth = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1];
    var numOfLines = app.selection[0].lines.length;
    var totalWidth = 0;
    
    
    for (var j = numOfLines - 1; j>-1; j--) {
          if(j == numOfLines-1) {
                totalWidth = totalWidth + (app.selection[0].lines[j].insertionPoints[-1].horizontalOffset - app.selection[0].lines[j].insertionPoints[0].horizontalOffset);
          } else {
                totalWidth = totalWidth + (app.selection[0].lines[j].characters[-1].horizontalOffset - app.selection[0].lines[j].characters[0].horizontalOffset);
          }
    }
    
    
    var percentage = frameWidth / totalWidth;
    
    
    app.selection[0].paragraphs[0].pointSize = app.selection[0].paragraphs[0].pointSize * percentage + "pt";
    
    

    Use the endHorizontalOffset property.

    One of the problems with text objects (which can be a blessing or a curse depending on what you happen to want to at some point) is a principle that I call "the last shall be first." This is because the last insertion of any particular text object is the same insertion point as the first of the next similar text element.

    Thus, for example,.

    nextPara = .paragraphs thisPara.insertionPoint [-1] [0]

    One consequence of this is that the last PointInsertion of a line has two different positions, the end of a line and the beginning of the next.

    Even the user interface is confused by the present. Click at the end of a story that ends with a paragraph mark and place an image. You will see that the cursor marker remains at the same insertion point, but before placing them, it is to the left of the line to which you added the image now is at the end of the previous line.

    It's very odd behavior which panicked me for more than a decade now.

    Dave

  • How to move the insertion point from editText ScriptUI?

    Hello.

    How to move the insertion point from editText ScriptUI?

    Please tell me the JS code.

    Thank you.

    I don't think you can. You can control the selection of text in an editText widget, but not the position of the insertion point.

  • Set/get an Insertion Point in a table cell

    I'm an iteration through the cells in a table to a series of calls to ITableCommands::SetCellText (). This written properly in cells, but I also need to set the insertion point to the first character in the cell somehow. I have the GridAddress - is - it possible to get the selection of who? (I was able to select the entire cell, but I want to get the text of her selection. Does anyone know how? Thank you.

    Bob

    I had the TextIndex of the cell using ITextStoryThread::GetTextStart.

  • Insert point to appear in firefox, how can I remove it?

    Recently, I noticed that I had an insertion point to appear anywhere that I click on the browser, ill post a picture to show what he looks like, how do I get it returned?

    Try to hit the F7 key.

  • Cursor without stopping text when pointed at it scalable

    Failed to stop the rolling when text cursor pointed at it. This works well on other browsers. Using the reset with the disable or enable add them on the scrolling text to stop with the cursor as it should, but once you close Firefox and return that it stops working. Even when the computer is restarted or shut down. I tried to use the restart of Firefox with Add ons disabled and also uninstalled Firefox 27.0.1 and reinstalled without success. The operating system is Mac osx Mavericks.

    John.B
    

    Hi cor - el,.

    Just edited this post. Did post still not working after trying all that was recommended but after restarting the Mac it seems to have come good. I am just hoping it stays like it. Thank you for your help very much appreciated.
    

    John.B

  • insertion point to jump when entering

    I just bought a new hp pavilion dm4 laptop (model dm4-2180us, windows 7). whenever I type, the insertion point jumps.  I am very careful not to make any contact with the touchpad, and again he jumps.  It seems to happen whenever I type, regardless of the program.  the only change I made since I bought the laptop in Device Manager, I've restored the mouse on ps2.  I did this because the touchpad kept gel, and this is the solution recommended for this problem.  It worked, but now I have a problem with the insertion point.  I appreciate any help you can give.  Thank you!

    Please follow the steps in the order

    1. Install the latest version of the BIOS from here
    2. Go to control panel > programs and features and uninstall the Alps touchpad driver, restart the computer and install drivers touchpad update from here

Maybe you are looking for

  • I want to go back to iOS 9

    my phone is ru ios 10 I don't like because the homescreen apps are delet off I want to go back to iOS 9 can you boys hel

  • Help understand the storage of the Photos on disc with Icloud

    Hello My hard drive is to the maximum of storage, even if it seems that I'm optimistic and I have 200 GB in I cloud storage. I'm trying to free up space on my hard drive, but it seems that if I delete the photos on my drive, it will remove them in I

  • Code 800b0100 - Windows Update encountered an unknown error.

    Hi, I have 5 important updates that are still unable to install because of the above error code. They are: Cumulative Security Update for Internet Explorer 8 for Windows 7 for x 64-based systems (KB2482017) Update security for Windows 7 for x 64-base

  • PPT. gets stuck and never opens

    Original title: ppt. I recently had a new hard drive put in. Now when I try to open my ppts. (all of the 07-1, he goes to the Media Center and gets stuck and never opens.) I have to go to programs, and then click powerpoint viewer every time? I just

  • Effects of the Playbook

    Hello I want to put an effect wipe or some other effect from one screen to the other, when I click on the button of the screen1 he must navigate to screen2. within the navigation, I want to put some effects. How can I do this, answer wih example line