Paragraph content display

Hello

I can able to display the first paragraph and the last paragraph contained in the page (if I only textframe in the page). My problem is if

I have more than one block of text, that means that if I have 3 text block, I want to display the first first subparagraph third and content textframe textFrame

the content of the last paragraph. I struggle with this onle could someone help me.

Current script of rock begins by identifying the block of text of interest using the selection. It's great for testing of concepts, but it does not get you very far in a production script.

Your three-step approach assumes that the 'last' image on the page is lower to the bottom of the page, but it could be three boxes side-by-side identical height.

Because they are threaded, I would use that to make this work. Presumably, the ultimate goal is to put the content of these paragraphs useful somewhere (for example a title common - although you can use variables of text for this).

Here's one approach: it assumes that none of the history management are in groups or online.

//DESCRIPTION: Get Contents of First & Last Paras on Pages of Story

(function() {
     if (app.documents.length > 0 &&
          app.selection.length > 0 &&
               app.selection[0].hasOwnProperty("parentStory")) {
          var myParas = getHeadsTails(app.selection[0].parentStory);
          for (var j = 0; myParas.length > j; j++) {
               alert(myParas[j].page.name + "\nhead: " + myParas[j].head + "tail: " + myParas[j].tail);
          }
     }
     function getHeadsTails(story) {
          var paras = new Array();
          var frames = story.textContainers;
          var pageRecord = new Object();
          pageRecord.head = frames[0].paragraphs[0].contents;
          curPage = frames[0].parent; // assumes frames are loose on page
          pageRecord.page = curPage;
          for (var j = 0; frames.length > j; j++) {
               if (frames[j].parent != curPage) {
                    pageRecord.tail = frames[j-1].paragraphs[-1].contents;
                    paras.push(pageRecord);
                    var pageRecord = new Object();
                    pageRecord.head = frames[j].paragraphs[0].contents;
                    curPage = frames[j].parent;
                    pageRecord.page = curPage;
               }
          }
          pageRecord.tail = frames[j-1].paragraphs[-1].contents;
          paras.push(pageRecord);
          return paras
     }
}())

To make this useful script, you will need to do something smart with the values returned by getHeadTails. It would be smarter this function return the paragraphs mentioned rather than the content of paragraphs.

Dave

Tags: InDesign

Similar Questions

  • our and twitch.tv do load properly (no content displayed) deleted the cookies/cache, nodnsprefetch, no proxy, safe mode, did not help!

    our and twitch.tv do load properly (no content displayed) deleted the cookies/cache, nodnsprefetch = true, ensured that no proxy, safe mode, did not help!
    The approximate layout works very well, but the real tv-content (contraction) or the real message (ggroups) texts will not be displayed. Also, by clicking on the wheel of preferences in ggroups will display a small empty box instead of a drop-down list filled with stuff.
    The pages all work properly in chrome.

    Note that youtube and google search normal, pages provider freemail, news pages and basically all the other pages I can think of work normally and 100%!

    I use linux 64-bit, firefox 22. However, this problem is not new, it's happened with older versions of ff too. I'm just tired of pulling up chrome every time, so I decided to report it here for a solution.

    Well, after you move a large number of files and the contents of the file autour, I found a solution:

    Delete the line
    user_pref ("dom.storage.enabled", false);
    of prefs.js solved the problem.

    Thank you.

  • I install app and all the collections to open as a content display! but no work!

    I have set up my application and all collections in it to open as a content display! but does not work! Everything opens in browser layout why it does not work?

    Can anyone explain it please! I want just the open application as a standard magazine from left to right! without a browser in each collection page! Is it possible? I tried several times and nothing!

    Thank you in advance to all the world!

    Whenever you launch a top-level collection, the collection appears as a navigation instead of the content display page. For example, if you create a collection and set the display of content, opening this collection from the app menu will display the page go, but the opening that same collection since another collection (for example, the 'House' collection) will honor the content view and view the first article. My guess is that you have started your collections from the app menu.

  • Table of contents displays the wrong fonts... Sometimes

    When I generate a table of contents, it generally works well, but sometimes text comes from the size and color of the text source instead of the assigned police of OCD.

    I have a my "TOC 1" paragraph style value 9/18 black points.  One of my headers is partially oversized and reversed text to white 36 p. It is not saved as a character style, just make it bigger.  Rather than follow the assigned table of contents 1 style, this text is available in white 36 p. I have other places where the headers are reversed and or resized and it displays fine in the table of contents.  In some cases, the table of contents comes in the color of the text source... but most of the time it comes of as it should be, as the color of the table of contents 1.

    Why the inconsistency?

    I keep digging and I found the answer. It's more than the "local formatting". It is "localpartial formatting" that replaces the table of contents style.

    I saw this initially because it was only a space empty at the end of the header which is different, so it was invisible to me.

    If the text in a header in the doc is exactly the same, no matter how it is modified locally, the TOC style is applied in its entirety.

    If any part of this text is different, the table of contents will be changed... BUT:

    Different changes apply to different parts of the line in the table of contents. So we can predict how some inmates / change will apply.

    If this is supposed to be a feature rather than a problem, it's a pretty bad; too many incompatible variables.

    The graph below shows some of the results possible.  At least now I know what is the problem and how to avoid it.

  • Table of contents displays a mess

    I created and generated a Table of contents and I'm having a weird problem.   He is a 19-page document and Table of contents is set up to display items 1 and 2.  Everything went well, except that to the a page Heading 1 on top of the page opens in the Table of contents under the heading level 1 below - i.e., they are in the wrong order!

    Yes, on the page.

    Text 9

    Text 10

    But he returned on the Table of contents.

    Text 10

    Text 9

    Any ideas on why it would do that?

    9 and 10 numbers page, or numbered paragraphs?

    TOC paragraphs in psotion on the page, then the things that are more left get picked up before things that are less advantage, if that makes sense.

  • iMac stopped book content display

    My new iMac has ceased to display the contents of some directories. If I select 'Get Info' some files appear, but not all. A counter appears at the bottom right of the finder for the directory window. Listing of the directory of the Terminal application, shows all files. Restart the computer to make the problem goes away, but it comes back eventually. Directories concerned are all my files user as Documents, downloads, utilities etc., external drives seem OK.

    Please read this message before doing anything.

    This procedure is a diagnostic test. It is unlikely to solve your problem. Don't be disappointed when you find that nothing has changed after you complete it.

    The test is intended to determine if the problem is caused by a third-party software that loads automatically at startup or logon, by a device, by a police conflict or corruption of system files or some system caches.

    Disconnect all devices wired except those required to test and remove all the expansion cards from secondary market, as appropriate. Start in safe mode and log on to the account of the problem.

    Note: If FileVault is enabled in OS X 10.9 or an earlier version, or if a firmware password is defined, or if the boot volume is a software RAID, you can not do this. Ask for additional instructions.

    Safe mode is much slower to boot and run as normal, with limited graphics performance, and some things work at all, including an audio output and a Wi - Fi connection on some models. The next normal boot can also be a bit slow.

    The login screen is displayed even if you usually connect automatically. You need your password to log on. If you have forgotten the password, you will have to reset it before you begin.

    Test in safe mode. Same problem?

    After testing, restart as usual (not in safe mode) and make sure you always have the problem. View the results of the test.

  • WebCenter spaces: content display model Presenter for the image gallery

    Hi all

    I use 11.1.1.6 Webcenter spaces

    I need to create a custom content presenter display model where a folder is chosen by the moderator. And all the files it contains will be shown as an album in a drop down.

    Whenever the user selects any album in the drop-down list, the images inside this album should be below in a thumbnail.

    I've set up two models one for the drop-down list and others to show images.

    I just need to know how can I use the two together. And how the selection of an album in the drop-down list should change the images?

    Should I call 2nd model presenter content from 1?

    Help, please.

    Kind regards

    Deepak

    Hello.

    I have a better approach:

    1. Store in a variable of limited scope, the folder selected in selectOneChoice.
    2. Use the cmfn:searchNodes function to retrieve the folder nodes
    3. Use the list of nodes with dt:contentTemplate.


    Information on the use of cmfn:searchNodes:

    Basically, he's waiting for the name of your repository of the University Complutense of MADRID and a CMIS query that must be built using the information in your file or a path.

    The CMIS query will have to be something like the following example (he gets all the contents of the folder with xCollectionId =988901828852000401

    SELECT * FROM cmis:document WHERE IN_TREE('/ucm/IDC:Folder/988901828852000401')

    
    
        
        Retrieve a collection of content nodes by CMIS query, specifying the maximum number of nodes to return.
        
        searchNodes
        oracle.webcenter.content.integration.servlets.functions.NodeRetrievalFunctions
        
          oracle.webcenter.content.integration.Node[] searchNodes(java.lang.String, java.lang.String, java.lang.Integer)
        
        
          
    ]]>
  • Deleting a tag character so that a paragraph tag displays

    Hello

    I have a burner that understand not vs paragraph character tags and set a series of topics using character tags and I need them to be positions so I can put in my OCD, but I can not of the Nations United-apply the tag of character for virgins and use a paragraph tag.  I found a work around and who was at the controls > remove Format that allowed me to apply a paragraph tag, but the tag of character is always applied to the text.

    Apart from deleting and rewriting the content, remove the character set tag shaped text?

    Thank you

    R

    Maybe I do not understand what you have. I just did a quick test:

    I have a line of text that is on my body paragraph tag; then I pointed out and apply a character tag to what it does change the colors and fonts. Then I selected the text again and applied my title 1 paragraph tag him - the appearance of the text has not changed, but he thinks now that's a title 1, not a body, a plus. I selected the text again and do the right click > characters > default paragraph font (which you can also navigate via Format > characters > default paragraph font) and he handed the text in my formatting for heading 1.

  • [JS CS5] difference between CS3 and 5 with paragraph.contents?

    It drives me crazy. I'm updating of scripts which ran well in CS3 so that they work in CS5. I ran into a strange (for me) behavior.

    After running the following in CS4:

    var myParagraph = myStory.paragraphs.item (myParagraphCounter);

    myParagraph.contents = "< LI >" + myParagraph.contents

    myParagraph.contents returns 'paragraph < LI > the text of the original.

    But after running the same lines in CS5:

    myParagraph.contents returns only "the text of the original paragraph.

    What happens here? This seems to be a real thing base... According to me, only missing me something obvious.

    I don't know, but as it's the replacement content is dangerous.

    I would do something like this:

    "myParagraph.insertionPoints [0] = .silence"

  • ";

    It works as expected?

    Substances

  • Firefox will not base on some sites (Commons) content display

    Hello:

    On some Web sites (common) Firefox ones do not display options on the site.
    These sites include Yahoo Mail, Twitter, Weebly.

    An example would be if there is a menu of choices such that delete, ad, tweet, etc instead of correctly it looks like a box with 4 points.

    Other browsers are fine. I have the latest Firefox and it started with the previous version as well. I have uninstalled/reinstalled without change.

    Windows 7 computer/Norton Anti Virus.

    If I can upload a screenshot.

    Thank you.

    You are welcome.

    We have seen this problem reported before on several occasions that people turn them off such fonts specified by the web pages.

    This is the consequence of Web sites using a font to display special icons rather than the images for each of them, as has happened in the past.

  • Tabs are labeled (Untitled) when Firefox is started or a new tab is selected and no content displayed

    I downloaded the myheritage.com software that automatically and without my consent changed my default browser from firefox to its own. I changed the default, but I still can't connect to the internet with firefox. The opening tab label is (untitled) and click on additional tabs the same product. In addition, none of the features - search for images etc. work, all lead to even empty, no content (Untitled) tab
    Update of firefox had no effect

    Your list of details more system shows the extension of XULRunner 1.9.1 called malware.

    See/questions/743526 and/issues/749007

  • Smartphones blackBerry desktop content display

    Hello

    I have a 9500. Just dropped a Treo 650. I found the palm funtion to view the content of applications for treo on the treo (on my pc) desktop very useful.  Can I do the same thing with the BlackBerry Desktop on my computer, plse?

    Unfortunately, there is no way to do it directly for BlackBerry users at the moment and I don't know if it will be in the future.

    One thing you can do with your BlackBerry is that you can plug it into your computer and show all files (images, documents, music, movies and more) that are stored on your device memory and memory card.  This can be done more easily through Windows Explorer on your computer.

    You can also synchronize your calendar/tasks/notes/etc to your computer and view using a program such as Microsoft Outlook.  Which is managed via the BlackBerry Desktop Manager under the synchronization section.

    I hope the info helps.

  • Can I use simple words in a paragraph to display other elements on the stage?

    I want to put a paragraph on the stage. The paragraph would look like this:

    'So forth and so... then, click here to read footnote 1, or click here to read the note 2.'

    As you can guess, I want the user to be able to click on the underlined words in paragraph - and have the appropriate notes appear.

    Is it possible to do this kind of thing in edge animate?

    TIA,

    Jeff

    Dear Jeff

    I did some try and find a way for you to do

    SYM. $("Text") .html ("here")

    $("#btn1").click (function () {}

    SYM.$("Note1"). Show();

    });

    Zaxist

  • YouTube content displayed on the iphone is too large for the site BunchOBlokes

    This is a report from a previous post which was sent past a different path. The output looks fine on the screen area, but fails at the level of the iPhone. Here are the results of the comparison between my site and BunchOBlokes. It almost seems that bootstrap does not work on my end. Any ideas what could cause this problem.

    Thank you

    Len Riccio

    berkleigh.flyingolfer.com

    In addition to the above, you will need to refresh the page after resizing to make sure that the modal is the right size. Normally a user would not resize the window so that it should not be a problem in reality.

  • How to get firefox to display all content of the Web site?

    Ex: bloomberg BAT Web site does not display fully, the graph of the section test score is not shown on the page, while that work correctly in Internet Explorer. The problem occurs only in the version 27.0.1. I try to reset firefox, remove it and then reinstall, delete the cookies & caches but none of these works.

    Can you help me solve this problem for all content displayed on the page.

    Better subject.

    Kim

    You can try the following steps in case of problems with web pages:

    You can reload webpages and ignore the cache to refresh potentially stale or corrupt.

    • Hold down the SHIFT key and click the Reload button
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Command + shift + R' (Mac)

    Clear the cache and cookies only from Web sites that are causing problems.

    "Clear the Cache":

    • Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox/tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the startup window Mode without failure.

Maybe you are looking for

  • Private browsing on right context menu on the shortcut icon of Mozilla's Firefox on MS Win XP

    I am already aware that the Mozilla Firefox browser has the ability to always start Firefox in private browsing mode by putting the brand into its Options on... However, I noticed that on MS Win 7 OS, we can run Mozilla Firefox browser directly, by c

  • I can not connect to any e-mail accounts 'user missing agent.

    Suddenly, I became unable to connect to any email and at least a few websites using Firefox. Œuvres of IE8 (64-bit). Finally, I have determined that the part of my Firefox 3.6.13 User Agent string had disappeared. I reinstalled it but it has subseque

  • Unknown physical channel

    I work with a ULx labviw driver for an of Measurement Computing DAQ hardware.  LabVIEW driver calls a DLL.  On the one hand of the routine, a physical entry is required.  However, it is not a channel input physics daqmx.  It's something else.  I chec

  • Presario V2036AP / PP967PA #UUF: Compaq Presario V2000 laptop / laptop SSD upgrade

    I have a Compaq Presario model No. Laptop computer V2036AP. It's Nr is PP967PA #UUF.   Other details are, Processors:-Intel Centrino RAM:-upgrade to 2 GB (1 GB x 2) OS:-upgrades to Windows 7 Home Edition, Service Pack 1, 32-Bit   The HARD original di

  • Zumo drive

    Hello I have on my Pavilion dv6 ZumoDrive. Don't know where it come from or how its on my computer. To run startup, but when I check with norton, they have no info on this. Anyone know? Thank you Naviv