How to find a paragraph with restarting numbering [CS3] [Javascript]

Hi,
Does any of you know how to solve this one:
I am making a script which needs to search for numbered paragraphs, and assign it with a specific paragraph style. It should go like this:
If the paragraph's numbering restarts (meaning it starts with 1) - the style should be "Number1".
If the paragraph's numbering continues from where it is - the style should be "Number".
It sounds quite simple in theory, and even doable with the simple "Find/Change" operation in InDesign, but when I went over the object model, I couldn't find a single method for my script to differentiate between the two cases. Does any of you know of a method for this?
Here is what I've got so far:
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.bulletsAndNumberingListType = 1280601709; // Numbers
app.changeTextPreferences.appliedParagraphStyle = "Number";
app.changeText ();
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
Thanks,
Ola

numberingRestartPolicies might be the thing you are looking for.

Similar Messages

  • How to find the paragraph and line numbers [CS3] [JS]

    Hello,
    I have a script that finds certain text formatting. Rather than having the script select all the instances of this text I have an alert that lists the page number and the contents for each found instance. The following gets those.
    var pageNumber = myFoundSet[n].parentTextFrames[0].parent.name;
    var foundContents = myFoundSet[n].contents;
    However, I would like to include the number of the paragraph where the found text resides as well as the line number in that paragraph.
    I am stumped on how to do this. Would be nice if there were a parentParagraph and a parentLine.
    Can someone point me in a direction?
    Thanks,
    Tom

    Tom,
    Assuming that you're looking for the number of the paragraph on the page, you'd need to count the number of paragraphs in the text frame that a found item occurs in. Since indexes are always counted from the beginning of the story, you isolate the text between the top of the page and the found item by starting at the index of the first insertion point of the found item's parent text frame and the found item itself. You capture that with this single long line:
    // range over ...
    paragraph_number = myFoundSet[n].parentStory.characters.itemByRange (
       // ... index of first ins. point of found item's parent text frame ...
       myFoundSet[n].parentTextFrames[0].insertionPoints[0].index,
       // ... and index of found item
       myFoundSet[n].index
       ).paragraphs.length;
    This includes any paragraph that started on the previous page. To find the found item's line number within its parent paragraph you do something similar:
    line_number = myFoundSet[n].parentStory.characters.itemByRange (
       myFoundSet[n].paragraphs[0].index, //first insertion point of paragraph
       myFoundSet[n].index
       ).lines.length;
    There's no need for parentParagraph and parentLine: myFoundSet[n].paragraphs[0] returns an item's parent paragraph, myFoundSet[n].lines[0], the item's parent line.
    Peter

  • How do I save a style of paragraphs with a numbered list in Pages 05?

    I wish to save a style of paragraph with a numbered list. Is it possible to save them at the same time in Pages 5 as it was in Pages 09'?
    Where are the shortcuts?
    Thanks.

    Yes, I know but there is no real list preset. The format command, when opened, shows a menu and I think you are using the word Style differently. A Style in 09 allowed one to save present formatting for several text appearance options, which is no longer possible in 05 "styles." Styles in text edting for applications like Word, OpenOffice, iBooks, and Pages 09 referred to a way to save a set of formatting command together and apply them with one click. That's the rub here in 5.
    Yes, you can apply a bullet as a "style" to a paragraph, bui you cannot save that formatting as a preset in any way to do it in one click. The issue is consistency and one click capability for multiple formatting features for a paragraph of text.
    Separating bullets and lists from the ability to maintain them in the Paragraph style removed the one click paragraph formatting option which is helpful for anyone who uses it more than a few times in a document.
    The need is for people who want to use common formatting for paragraphs and maintain a one-click option to apply text, indent, spacing, and bullets in one click, not spread out in several menus and lists. 
    If you can explain how to do this in Pages 5 I will be very happy and you will have saved me many clicks. Otherwise I will continue to use the bullet "style" list drop down menu.

  • How to find report created with Report Painter?

    Hi!
    how to find report created with Report Painter?
    Here is the information that I have:
    Object filename, let's say <b>Y_P01_90000001</b>
    Report painter object <b>INV-102</b>
    The thing is that Library is unknown, thats why I can not find it via GR22...
    Any ideas?
    Will reward,
    Mindaugas

    Check in GRR3 under <b>INV</b> node...

  • How to find material recieved with excise duty or without excise duty

    HI
    how to find material recieved with or without excise duty , and which table  these data store . Because we need to develope one new report.
    Regards
    Ganesh

    HI,
    Check the report J1I5 , For the Material received with the Excise Details,
    Table "J_1IEXCHDR" will store the Excise invoice header data.
    Regards
    Mascot.

  • How to find sql statement with Unix process pid

    Hi
    how to find sql statement with Unix process pid
    is there any view to find that.
    please if so let me know
    Thanks in advance

    this is how I am doing this:
    oracle 7352340 7459066 0 07:47:10 - 0:00 oracleJDERED (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    oracle 7459066 5386396 2 07:47:10 pts/1 0:01 sqlplus
    select sid,serial# from v$session where process='7459066';
    SID SERIAL#
    2178 6067
    select sql_text
    from
    v$sqlarea a,
    v$session b
    where a.hash_value = b.sql_hash_value
    and b.sid = 2178
    ;

  • How to find index name with primarykey and column on a table?

    Hi,
    how to find index name with primarykey and column on a table?
    please help me.
    Thankyou.

      1  select ac.table_name, ac.index_name, aic.column_name
      2  from user_constraints ac, user_ind_columns aic
      3  where ac.constraint_type = 'P'
      4   and  ac.index_name = aic.index_name
      5* order by 1,2,3
    SQL> /
    TABLE_NAME                 INDEX_NAME                COLUMN_NAME
    ACTION_TABLE                 SYS_C0011033                NESTED_TABLE_ID
    ACTION_TABLE                 SYS_C0011033                SYS_NC_ARRAY_INDEX$
    CATEGORIES_TAB                 SYS_C0011038                CATEGORY_ID
    CUSTOMERS                 CUSTOMERS_PK                CUSTOMER_ID
    INVENTORIES                 INVENTORY_IX                PRODUCT_ID
    INVENTORIES                 INVENTORY_IX                WAREHOUSE_ID
    LINEITEM_TABLE                 SYS_C0011034                NESTED_TABLE_ID
    LINEITEM_TABLE                 SYS_C0011034                SYS_NC_ARRAY_INDEX$
    ORDERS                      ORDER_PK                 ORDER_ID
    ORDER_ITEMS                 ORDER_ITEMS_PK                LINE_ITEM_ID
    ORDER_ITEMS                 ORDER_ITEMS_PK                ORDER_ID
    PRODUCT_DESCRIPTIONS            PRD_DESC_PK                LANGUAGE_ID
    PRODUCT_DESCRIPTIONS            PRD_DESC_PK                PRODUCT_ID
    PRODUCT_INFORMATION            PRODUCT_INFORMATION_PK           PRODUCT_ID
    PROMOTIONS                 PROMO_ID_PK                PROMO_ID
    WAREHOUSES                 WAREHOUSES_PK                WAREHOUSE_ID
    16 rows selected.

  • How to find by email with JPA?

    How to find by email with JPA? My this but not worked
    public WnUser findUser(WnUser email) {
    return (WnUser) em.createQuery
    ("SELECT object(u.email) FROM entities.WnUser u WHERE u.email =:email").setParameter("email", email.getEmail()).getSingleResult();
    javax.ejb.EJBException: javax.persistence.NoResultException: No entity found for query
    12:23:44,843 ERROR [STDERR]      at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
    12:23:44,843 ERROR [STDERR]      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
    12:23:44,843 ERROR [STDERR]      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
    12:23:44,843 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)

    First off, you are not really doing:
    GWAccount->GWAddressBook->GWAddressBookEntrie->
    get_EmailAddress,get_DisplayName()
    are you?
    If you enter the full line, it will read in all
    of the entries each time it is called.
    You should break each part into an object:
    gwAccount
    gwBook
    gwEntries
    I'm not sure what you are doing.
    Are you trying to compose an email?
    If so, why are you not using Recipients.Resolve()?
    Are you trying to get the recipients from an email?
    Preston
    >>> On Friday, April 16, 2010 at 1:26 AM,
    hillp<[email protected]>
    wrote:
    > as title,
    > i can get the display name from the to, cc, bc edit box,
    > then i need to get the email address,
    > current i use object API to query:
    >
    GWAccount‑>GWAddressBook‑>GWAddressBookEntrie >get_EmailAddress,get_Di
    splayName
    > but i find it is really slow when there are many contacts, example
    > 10000.
    >
    > so is there any other effective method to get the email address?

  • How to find a routine with it's technical name

    Hello!
    I am wondering how to find a routine with it's technical name (e.g. "ROUT 7QAXE7SDXIVW4BJ2S2UL3HLAS" as shown in the error message in a transport log).
    So I would like to find out, where this routine is located (w.g. which characteristic/key figure in which transfer/update rule).
    Any ideas welcome. Thanks, Thomas

    Hi Thomas,
    You can try the following:
    Look up table <b>RSUPDROUT</b>with the GUID of your routine (like 7QAXE7SDXIVW4BJ2S2UL3HLAS)in the ABAP Code ID field selection. This will show you the InfoObject it is created on, and the GUID of the update rules. If you click on the Check Table button, you can find out the data target and InfoSource of the Update Rule.
    In table <b>RSAROUTT</b>you can again use the GUID of your routine to check the description assigned to the routine during its creation.
    I am not sure if this works for the routines of transfer rules....still checking it and will update if anything turns up.
    Hope this helps...

  • HT1529 how to find my iphone with the serial number

    hi
    could you please tell how to find my iphone with the serial number ?

    Sorry, there is no way to do that.
    What To Do If Your iDevice or Computer Is Lost Or Stolen
    iPhone, iPod Touch, and iPad
    If you activated Find My Phone before it was lost or stolen, you can track it only if Wi-Fi is enabled on the device. What you cannot do is track your device using a serial number or other identifying number. You cannot expect Apple or anyone else to find your device for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty.
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should have done in advance - before you lost it or it was stolen - and some things to do after the fact. Here are some suggestions:
    This link, Re: Help! I misplaced / lost my iPhone 5 today morning in delta Chelsea hotel downtown an I am not able to track it. Please help!, has some good advice regarding your options when your iDevice is lost or stolen.
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T. Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. What to do if your iOS device is lost or stolen
      6. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      7. Find My iPhone
      8. Report Stolen iPad | Stolen Lost Found Online
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on iCloud
      3. OS X Lion/Mountain Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)
    Mac Computer
           Find My Mac can be used from Find My Phone at iCloud.com and via Find
           My Phone on your iDevice.
          The following is third-party anti-theft software:
               1.  STEM 2.1
               2.  MacPhoneHome 3.5
               3.  MacTrack 7.5.0
               4.  VUWER 1.7
               5.  Sneaky Bastar* 0.2.0
               6.  Undercover 5.1.1
               7.  LoJack for Laptops
               8. Hidden 2.0

  • How to find IDOC no with reference to one billing document no

    Dear all,
    Can you please tell :
    How to find IDOC no with reference to one billing document no
    Thanks

    Hi Pavan,
    You are absolutely correct.  But what i need to know is sometime , even in the sales order there will be no output type (basically inbound) which can be found as suggested by Sunil - I think that is the most relevant way to find the IDOC no. Hope you will agree with me. Again how to activate by IAN is also guides the idea. Only thing we need to know the exact parameter to be maintained in own data.
    Thanks for your one of the valid suggestion.
    Regards,
    Ranjan

  • How to create a column with increasing numbers in h:dataTable?

    I need to make a table that would have a column with order numbers, starting from 1 and increasing by 1 for every row. I tried using JSTL for this but it seems it is being ignored (as it probably should). My code is below. I know I am supposed to use getRowIndex() with bound tables, by my table isn't bound to anything...
    I could hold the number in the backing bean but that seems like a total overkill.
    Is there a proper way to this in JSF? Could I maybe somehow reference this (meaning tha table itself) within the EL expression?
    <c:set var="month" value="0" />
    <h:dataTable value="#{loansManager.rates}" var="rate">
                <c:set var="month" value="${month+1}" />
         <h:column>
              <f:facet name="header">
                   <h:outputText value="Month" />
              </f:facet>
              <c:out value="${month}" />
         </h:column>
         <h:column>
              <f:facet name="header">
                   <h:outputText value="Rate" />
              </f:facet>
              <h:outputText value="#{rate}" />
         </h:column>
    </h:dataTable>

    Bind the datatable to the backing bean and use HtmlDataTable#getRowIndex().
    You can find here an example: [http://balusc.blogspot.com/2006/06/using-datatables.html#AddRowNumbers].

  • How to find a control with code

    I could find the control with the Test Builder, but now, what I want is achieve that by code. How could I define what the property
    to search? Any help would be appreciated.

    Hi mokpoju,
    Generally, I know that if we want to find a control by code, we will need to add the searchproperties or filterproperties to find this control in the UIMap.Designer.cs file.
    For example, you could use this searchproperties or filterproperties to find the control's ID, Name properties etc.
    For more information, please refer this following blog to check your issue.
    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx
    http://blogs.msdn.com/b/mathew_aniyan/archive/2009/02/12/hand-coding-a-coded-ui-test.aspx
    Hope it help you!
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Find PS GUID with WBS Element (POSID) or Project Definition (PSPID)?

    Hi all,
        I am creating the custom Extractor similar to 0CO_OM_WBS_1 (WBS elements: Costs) to load into 0PS_C041 (Project System - Controlling (New)). I have the WBS Element (POSID) & Project Definition (PSPID) and I how can I find the GUID (UUID in X form Binary) so that I could map it into 0PSGUID InfoObject in the Transformation. We have WBS Element & Project Definition (PSPID) as Navigation Attributes of 0PSGUID instead of under some Dimension in 0PS_C041 Cube and that's why I am trying to find the GUID with WBS Element (POSID) or Project Definition (PSPID), PLEASE.
    Thanks,
    Venkat.

    Hi Bala
    Yes, you have put it rather correctly.
    We use WBS elements for booking and posting time (client requirement). So what I am looking for is WBS Elements with the system status TERL (Time and Expense Released).
    I talked of the deletion flag also, because a WBS element flagged for deletion can't be used. It's one of the criteria to screen the WBS elements.
    I hope it's clearer now.
    Vinitha.

  • How to find jars compatibility with JDK 6

    Hi All,
    Could you please let me if there is any way to find out if a given jar version will be compatible with the JDK version 1.6 (i.e. java 6)?
    Let’s say I have Junit version 3.8.1 currently and it is working fine with current JDK version 1.4.2_11. I want to upgrade JDK version to 1.6 (java 6), then how to find out current JUnit version will be compatible with JDK 6? If not how to find out which version of Junit will be compatible with JDK6?
    Please let me know if you need more info.
    Regards,
    psg

    spring_1_2_5.jarI assume you are using spring framework 1.2.5.
    In this case, you should look at this framework documentation/change log to see what the requirements are.
    I think you could download spring framework 1.2.5 bundle (with dependencies). You can then look at the META-INF/MANIFEST.MF of every of jar
    (especially third party libraries) in order to know its version.
    Every framework release must have been tested and compatibilities resolved, so the job of finding what jar goes with this release is already done.
    Example (spring 1.2.x):
    fixed JdkVersion to properly detect JDK 1.6/1.7 (Java 6/7) as higher than 1.5 (Java 5)See [change log|http://static.springsource.org/spring/docs/1.2.x/changelog.txt] here
    Hope it helps

Maybe you are looking for

  • Since FF4, FF has been slow on start-up or doesn't at all.

    This started since I upgraded to FF4. Last night I closed firefox to try something. I got on this morning, clicked the icon in my tray and it wouldn't load. Literally 5-10 minutes and it didn't open. I clicked again and it said it was already running

  • Feature Request: Log of alerts

    Network Monitor has been great at identifying high usage events:  disk, memory, etc.   However, many of those can be tied to backups running or SQL Server environments where ram and disk usage are going to be high for periods of time and there is not

  • Had to create a new user on my Mac, now when I load an .exs instrument into EXS24, it doesn't play?

    It will load the instrument, but when i hit the keys, i still hear EXS24's standard tone.....

  • Adding a date stamp using Acrobat XI

    Hi there I want to add a date stamp to a voucher PDF, so that when it is downloaded and printed out, it displays today's (system) date. I followed the tutorial at: http://tv.adobe.com/watch/acrobat-x-tips-tricks/quick-tip-how-to-add-a-date-stamp-to-a

  • Slow Wireless think i've solved problem

    Hi All, Thought I'd put this up if anynone else has had a similar problem, apologies if this has been already raised. Syptom: Wireless speeds have dropped to over half normal expected speed against a fixed wired connection using HUB 3. Fixed Ethernet