[JS CS3] Need an array of paragraphs when more than one story

Hello,
If I have a document with only one story the following line returns an array of all the paragraphs. I can then iterate through the array to my hearts conent.
var paraRef = app.activeDocument.stories.everyItem().paragraphs;
However, if there is more than one story, then, according to the Data Browser, some of the object Paragraphs contain more than one paragraph and some of the object Paragraphs are invalid. The length of paraRef is correct, i.e. it equals the total number of paragraphs in the document, but each member of this array either  "bunched up" or contains nothing.
How can I write this so that  when I have more than one story I can get an array of all the paragraphs?
Thanks,
Tom

Thanks, Harbs and Dave!
Before I saw your answers I came up with a (longer) solution:
var storyRef = app.activeDocument.stories;
var arrStories = [];
for(var j = 0; storyRef.length > j; j++){
    arrStories.push(storyRef[j])
    }//end for
var arrParas2 = [];
for(var x = 0; arrStories.length > x; x++){
    for(var y = 0; arrStories[x].paragraphs.length > y; y++){
        arrParas2.push(arrStories[x].paragraphs[y]);
        }//end for y
    }//end for x
But I am curious about something. Your solution and my solution both result in an array of all paragraphs in the document but the data browser shows these arrays in different ways. I am wondering how to intrepret them.
Your solution does not show the indexed paragraphs, mine does. See the images below.
Your solution:
My solution:

Similar Messages

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • Form that is a map of Ohio. I created layers for each county so I can click and it highlights, but I need to be able to click more than one. How do I do that?

    Form that is a map of Ohio. I created layers for each county so I can click and it highlights, but I need to be able to click more than one. How do I do that?

    Looks nice!
    I understand what you've done now. You used the "Set Layer Visibility" command which sets the on/off state of all the layers at once. What you need is a more subtle approach, one that will only change the state of the specific layer associated with the button, not the rest of them (so that you could have multiple layers enabled at the same time). The way to do that is by using a script.
    I wrote the script for you and applied it to the top-left counties (WILLIAMS and FULTON), in the attached file. You can now copy the actions I associated with those buttons to the rest of them, and it should work as you want it to.
    The file: MAP-HHA-Geographic(3)_edited.pdf - Google Drive

  • Use of layout when more than one parameter - Error Missing Parameter Values

    Hi,
    Is it possible to use a crystal report which has more than one parameter as the layout for the bill of materials report.
    I have 3 parameters
           1. DocKey@       The Bill of Materials to be printed
           2. Number of levels to be printed
           3. type of levels to print.
    When I try to print it gives me the error Missing Parameter Values.
    I have tried changing the DocKey@ to CodeKey@ but the same error.
    Does anyone now where to find a list of these tokens?
    Thanks
    Chris

    I looked at the crystal report conversion to try to find what parameters it used and found none.
    I have managed to create and use a crystal report to replace the production order using DocKey@ as the parameter.  This works within SAP.  However I have converted the system production order to crystal reports and from the converted report I cannot see any parameters at all.
    How and where can you find out what paramters you need to use to replace any PLD report?  Several reports have multiple selection criteria before the report prints.  How can you find out what their tokens are called?  I am starting to pull my hair out.  I am getting great help from this forum, but do you know any documentation which actually explains this area.
    Thanks
    Chris

  • Macbook freezing when more than one program runs

    Hello all,
    My Macbook is about a year and a half old. A few weeks ago, it crashed catastrophically, and the geniuses at my local store replaced the logic board.
    Since getting it back, it's been crashing almost every time I try to run more than one program, such as itunes and safari. Ichat video or photobooth on their own cause it to freeze. The freezing process is gradual; first the program I'm looking at freezes, but I can navigate to other programs, but within a few minutes those freeze as well. During the freeze, the cursor moves (in beachball shape) but the screen is unresponsive and apple-option-escape has no effect; the only solution is to manually turn it off. It's also taking longer and longer to boot up. This happens when it's plugged in as well as on battery power. It's gotten to the point that I'm scared to do work on it, because I can't trust it to work long enough to save my data. What happened? Is this the result of my "fixed" logic board or something else? I am getting SO FRUSTRATED by how unreliable my macbook has become!!

    To rule out any 3rd part apps/additions are causing the problem, try booting into Safe Mode...
    http://docs.info.apple.com/article.html?artnum=107392
    Have you replaced/changed Ram lately? ...if so, try reverting back to the old.
    You could also ensure you've run your standard Maint. scripts (via Onyx, Cocktail etc...) and perhaps boot to the Install DVD to verify/repair the hard drive and its permissions. Booting to the Install DVD and running the Apple Hardware Test (hold 'D' on startup) could also reveal things.
    Failing all that, try resetting the SMC and Pram...
    http://docs.info.apple.com/article.html?artnum=303319
    http://docs.info.apple.com/article.html?artnum=2238
    To rule out a 'bad' hard drive you could either replace it physically or try booting from another Macbook via firewire...
    http://docs.info.apple.com/article.html?artnum=58583
    These are all a bunch of general procedures that the user can try to eliminate the issues - if nothing works, you'll need to make another trip to the genius bar.

  • Need to download JAR files from more than ONE HTTP-server ?

    Hello,
    We have a need to download JAR files for an application, from more than ONE HTTP-server, i.e. any specified HTTP-server in an extremely secure network.
    Does a solution exist for this requirement ? Is it possible to design a solution our selfes for this problem ?
    Best Regards
    Peter

    We have a need to download JAR files for an
    application, from more than ONE
    HTTP-server, That can be done using the extension element
    from within the resources element of the main JNLP.
    http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html#resources
    The extension element should refer to another JNLP
    (on the other site) that refers to the Jars. The jar files
    in any such (foreign) JNLP need to be signed, and the
    JNLP files should declare itself as a <component-desc>.
    For any level of detail on using extensions/components,
    download the spec. mentioned in the second paragraph
    of that section linked above. Unfortunately I can find no
    web browsable form of the information.
    Here is an example though..
    http://www.javasaver.com/testjs/jws/04/glclock.jnlp
    This (sandboxed) screenaver demo comes off my
    javasaver site. It refers to the JOGL API via an
    extension element in the JNLP, that points directly
    to the JOGL site. You might notice the security
    warning that is produced mentions..
    Name:      JOGL
    Publisher: sun microsystems, inc
    Source:    https://jogl.dev.java.net
    ..i.e. any specified HTTP-server in an
    extremely secure network. I do not know about an extremely secure network,
    but if it is OK to launch a normal JNLP for an
    application with a 'main()' from the server, I guess
    it should be OK to launch extensions off it - you
    might need to set up some tests.

  • The file is not readable, when more than one file open

    Get this error when I try to open more than one file. Happens on different files, but especially on jobs that have side panels on packaging. The files have placed .psd images. Happens on different computers (10.6 & 10.8.2).
    Can get the file open usually by closing the othere open file, but then is hard to copy and paste between files. Sometimes I get this when trying to open one file, but restarting Illustrator usually fixes this.
    Have tried working directly from the hard drive, and still get this problem. Does to follow an exact pattern, can try to open file a, then b one day thsi will work another will fail. Seems like something is corrupting the memory, and usually happens with more complex files. Happens in CS5 & CS6, though I mostly work in CS5.

    Anyone else getting this error?

  • Text color changes when more than one color is used in the same paragraph in a bulleted list

    I work in a print shop on designers' files preparing them for print. Machine I use is an iMac, plenty of RAM, running Tiger 10.4. Here is my problem: A PC user sent us an InDesign CS3 file. A portion of the text is styled as a bulleted list with character color and bullet (the solid circle) defined as (default) black. However, the style is over-ridden on the bullet and first two words following the bullet with a spot color red, which is present in the Swatches palette (PMS 186). The remainder of the sentence stays black. The text somehow lost this override, and instead of keeping the 2 different colors all the text changed to black. This seems to have occurred when I saved the file on my machine. When I go back and open the original file the text is still colored both red and black. I think that the file was originally an InDesign CS2 file, and could even have been a Indd version 1 or Quark file. Why did the color change with no user intervention? Also, I can't understand why, when the first 2 words are highlighted and changed to red, the bullet also changes to red. (That is good, of course, because that is what we want, but I don't understand how that happens when the character style is black, and I can't even highlight the bullet itself). I sure would appreciate any ideas anyone has on this, I have to try to explain why we printed the text in black when it was supposed to be red and black!

    thanks Alan and Bob. Nothing has explained the loss of color so far.
    Alan, I will suggest to the designer that she use a nested style. I wonder if that will make the styling more stable moving accross the different platforms.
    Bob, I feel like you may have thought, as I did, that hundreds of saves and saved-as and many different applications would have damaged the file, but as you could see by the History, the file was fairly fresh.
    There is a very outside chance that I wiped out the style overides by command click but I am really careful and I doubt it.
    So I'll thank you both again and check back each day, perhaps this will happen to someone else and become an issue. I have tried to repeat my actions and cause the error again but to no avail.

  • *** I need to pull back just one record when more than one is listed.... **

    I have two (or more sometimes), there is a field called POC_type and then the POC_name, the POC_Name is different, but the rest of the records are the same, I only want to pull back the first record so I onlist one POC_Type, Name, ...
    Below is the code I have right nwo, but like I said it is pulling back multiples becase they have been entered into the systme twice (because of the diff POCs)...
    select distinct m1.*
    from  report_surv_ques_poc m1,
      (select investment_id, investment_acronym, investment_name, count(*)
      from  mv_surv_ques_poc
      where poc_type = 'Program Manager'
      and poc_status = 1
      group by investment_id, investment_acronym, investment_name
      having count(*) > 1) m2
    where m1.investment_id = m2.investment_id
      and m1.poc_type = 'Program Manager'
      and m1.poc_status = 1
      --and m1.investment_id = 14003
    order by m1.investment_id

    Thanks...
    I am using 10g.
    My code is now like...
    select distinct m1.*
    from  report_surv_ques_poc m1,
      (select investment_id, investment_acronym, investment_name, count(*)
      from  mv_surv_ques_poc
      where poc_type = 'Program Manager'
      and poc_status = 1
      group by investment_id, investment_acronym, investment_name
      having count(*) > 1) m2
    where m1.investment_id = m2.investment_id
      and m1.poc_type = 'Program Manager'
      and m1.poc_status = 1
      and m1.survey_id IN (67201, 67208)
    order by m1.survey_idshould it be like:
    WITH get_rows AS
       SELECT DISTICT ml.* ROW_NUMBER () OVER (ORDER BY m1.investment_id) AS rno
       FROM from  report_surv_ques_poc m1,
         (select investment_id, investment_acronym, investment_name, count(*)
            from  mv_surv_ques_poc
          where poc_type = 'Program Manager'
            and poc_status = 1
       group by investment_id, investment_acronym, investment_name
      having count(*) > 1) m2
      where m1.investment_id = m2.investment_id
      and m1.poc_type = 'Program Manager'
      and m1.poc_status = 1
    ) SELECT * FROM get_rows WHERE rno =1;cause that is not working ... I am sure I have something wrong....
    Kipp

  • How to config the digital write-to-line so it would independent when more than one is being used

    when one digital wirte-to-line is used in the labview vi, a good logic high(5v) can be read using a voltmeter,but when two or more digital write-to-lines are being using at the same time,the logic high seemed to have split voltages and thus having a bad logic high.how to make sure that in the labview program,that when many digital write-to-lines are used at the same time,all of them can abtain a good logic high (around 5v).
    I need the solutions urgently.
    grays
    np

    Hello,
    The probable reason you are seeing the behavior you are is due to a reconfiguration of the digital port. The Write to Digital Port VI is setup to configure the entire port, then write to one line (default settings). If you reconfigure the port it will reset all the lines, and then write your new value. You will want to use the iteration input on the Write to Digital Line so you can avoid the reconfiguration issue.
    The first time the Write to Digital Line is executed in your code wire a 0 to the iteration (or leave it unwired). This will configure the port for write and write your first value. The next time you use the write to digital port VI wire an integer greater than 0. This will bypass the configuration step and simply write the new value to the
    line. You can open the Write to Digital Line VI to see how the iteration input effects the execution and configuration of the digital ports.

  • How to set the Certifcate to use for SSL when more than one available?

    I apologise for bad wording of question.
    We have a 11g Directory Server and when we created the directory instance it generated a self-signed certificate. very nice.
    We have recently requested and installed a CA signed certifcate, so we now have TWO certificates in the directory certificate store. Default Certificate and the new Server-Cert (the CA signed one)
    LDAP clients STILL seem to be presented with the self-sgned certificate though.
    Simple question... how do I make my Server-Cert the 'default' certificate presented to LDAP clients ???
    I would rather not delete the self-signed cert if possible.
    I cant find any documented method to achieve this.

    # Listing Certificate
    $ /certutil -L -d <path>/slapd-abc/alias -P slapd-
    # Add Trust by adding CT
    $ certutil -M -n "GeoTrust DV SSL CA" -t CT,, -d <path>/slapd-abc/alias -P slapd-
    # Verify the setup.
    $ certutil -L -d <path>/slapd-abc/alias -P slapd-
    ( You should see the CT beside the relevant cerficate, making it default for SSL communication )
    GeoTrust DV SSL CA CT,,
    Link : http://docs.oracle.com/cd/E19656-01/821-1504/6nmg10b6g/index.html ( Look around for different steps for configuring SSL )
    JPrince

  • Data Merge - Not removing blank lines when more than one in a row

    I am having the same problem as mentioned here: http://forums.adobe.com/message/2109531#2109531  That post is for some reason set as "answered" though the poster said the latest update did not resolve the issue.  Has anyone found a solution to this issue?
    Thanks much,

    I"d suggest you try running the merge WITHOUT removing blank lines, then use  GREP to remove empty paragraphs. There's a pre-written saved query in the list.
    Peter

  • 1099 amounts not being combined when more than one vendor same TIN

    I have multiple vendors within the same company code with the same tax id number. When the 1099's are generated, the amounts for both vendore are not getting combined. So if for one of the vendors, he has been paid $4850.00 on one vendor number, and on his other vendor number, he has been paid $500. His 1099 should be $5350.00, but it is being generated for only $4850.00.
    This is only one example of this problem. Does anyone have any idea what could be causing this? Everything I have read says the 1099's should combine based on tax id number.But this is not happening.
    Thanks
    Alicia

    Sorry to keep dwelling on this subject. I was able to accumlate the totals for 8 vendors with the same tax id sucessfully. However, all of the payment amounts exceeded the mininum for the 1099 tax type royalty.
    I have not been able to take two vendors, one with let's say 6453.02 in payments, and another with the same tax id number, who only has a payment of $500.00. The $500 is below the misc limit. The 1099 form and file only show 6453.02, however the report does show the two amounts. These vendors are in different company codes.
    In the define withholding tax codes, I have set the accumulation type to be combined accumulation. Still the two amounts are not beng added together on the form.  Using the help for the field "combined accumulation", there is a statement "these vendors may belong to different company codes if these company codes are assigned to one tax on sales/purchases group".
    Can someone tell me where I would assign this? My company is not currently using either sales or purchasing.
    Thanks
    Alicia

  • Native SQL Update statement error when more than one field used

    Hi, I would make it simple. I update directly to a SQL server.
    1-
    When I update only one field works.
    LOOP AT IT_MAT.
    EXEC SQL.
    UPDATE Articulos SET PrecioSinImp = :IT_MAT-PRECIOSINIMP        WHERE Modelo = :IT_MAT-MODELO
    ENDEXEC.
    ENDLOOP.
    This give me sy-subrc = 0
    When I Try to update several fields doesnt works, any would can help me ?.
    LOOP AT IT_MAT.
    EXEC SQL.
      UPDATE Articulos SET PrecioSinImp = :IT_MAT-PRECIOSINIMP
                           Descripcion = :IT_MAT-DESCRIPCION
      WHERE Modelo = :IT_MAT-MODELO
    ENDEXEC.
    ENDLOOP.
    This give me dump SQL error 170.
    2- BTW, I have to leave this report program in a job so the data would be updated once a day in a job, so I have to update the existing data and add new one.
    I Was thinking doing something like this.
    LOOP AT it_table.
    UPDATE DQL TABLE
    IF sy-subrc <> 0.
    INSERT DQL TABLE
    ENDIF.
    ENDLOOP.
    This may works ??? because if this not work, I have to select single each one of the data in the SQL table, if it was founded UPDATE otherwise INSERT. And I dont like this aproach.
    Thx

    Hi Rodrigo,
    I feel that your requirement is as below:
    Depending on the criteria in the where clause, check whether the record exists or not.. If it does, then update the record with new values, else, create a new record..
    You can do the same as below:
    LOOP AT it_mat INTO e_mat. (e_mat of same structure as it_mat)
    MOVE : xxx TO e_mat-yyy... and so on (Only change the non-key values)
    MODIFY dbtable FROM e_mat.
    ENDLOOP.
    This code will create a new record if a record with the given key values in e_mat is not found, else, it will update the existing record with the new non-key values in the structure e_mat.
    Thanks and Best Regards,
    Vikas Bittera.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • VBA fails when more than one document is open

    I developed a complex program for manipulating a multitab workbook and distributing it within the company. I did all the development work with only the one workbook open. When users open the workbook and have other workbooks open, the focus appears to change
    among the workbooks. As a result, some of the macros try to run against the other workbooks and not the intended workbook.
    Most of the programming uses ActiveWorkbook or ActiveSheet. How do I ensure the macros run against the desired workbook?

    Re:  regain control over when code runs
    Some Options...
    1.  Put a button on the sheet and let the user decide when to run the code
    2.  Change ActiveWorkbook to ThisWorkbook
    3.  Change ActiveSheet to ThisWorkbook.ActiveSheet
    4.  Use the actual workbook and sheet names... Workbooks("Sludge").Worksheets("Mud")
    Also suggest you find somebody in the  company to try your code before doing a wide distribution.
    Jim Cone
    Portland, Oregon USA
    free & commercial excel programs (n/a xl2013)
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

Maybe you are looking for

  • Can I deploy an Oracle Forms Application in WebLogic Server?

    Dear all: I need to know if Oracle WebLogic Server supports Oracle Forms applications? I am looking some clue in the documentation, but I didn´t find something clear yet, please help me. Thanks Edited by: user637951 on Nov 18, 2008 6:25 AM Edited by:

  • Iomega USB Hard Drive won't appear on my desktop. Please help

    Hi, I purchased an Iomega desktop hardrive about 3 months ago and all has been working well. I had no problems working it with my MacBook Pro and backed up all my files easily. I now need to get some files from my Iomega hard drive, but now when I sw

  • White box

    I've used Pagemaker for 25 years and am having some issues with InDesign. How do you make a simple white box for masking over items? Thanks.

  • InDesign PDF type distortion

    I am creating PDFs to be sent by email and to be viewed online. I am using the [smallest file size] setting. I am not using any transparency in the files. The type is distorting/corrupting in some places. In places the type displays crisp and clean a

  • [svn:fx-trunk] 7204: Tweaks to appearance of Halo skins for WindowedApplication/ Window to match Spark appearance.

    Revision: 7204 Author:   [email protected] Date:     2009-05-21 16:30:20 -0700 (Thu, 21 May 2009) Log Message: Tweaks to appearance of Halo skins for WindowedApplication/Window to match Spark appearance. Bug: SDK-19653 QA Notes: Baseline images of Ha