How can I count the appearance of the paragraph style "H1" used in an .indd document?

How can I count the appearance of the paragraph style "H1" used in an .indd document?

OS: 10.8

CS6

extend the script

Hello

must be sth. like...

pStyleNameToFind = 'Grundtext';;//Your pStylename here

app.findTextPreferences  = app.changeTextPreferences = NothingEnum.NOTHING;

app.findTextPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyles.itemByName(pStyleNameToFind)

var pHits = app.activeDocument.stories.everyItem().paragraphs.everyItem().findText();

var counter = 0;
for(var i = 0; i < pHits.length; i++)
{
    if(pHits[i].length != 0) counter = counter +1
    }

app.findTextPreferences  = app.changeTextPreferences = NothingEnum.NOTHING;

alert(counter +  ' of ' + pHits.length + ' paragraphs in active Document are formatted with paragrahstyle ' + pStyleNameToFind)

Tags: InDesign

Similar Questions

  • How can I customize the paragraph styles in the spreads for left or right side?

    Hi, I use paragraph styles in 2 pages.

    I would have the same paragraph style on a left page to be indented from the left and when the same paragraph is on the right page, it is indented to the right.

    Is it possible to do?

    Very much appreciated.

    Rob

    rob_scozzari wrote:

    Hi, I use paragraph styles in 2 pages.

    I would have the same paragraph style on a left page to be indented from the left and when the same paragraph is on the right page, it is indented to the right.

    Is it possible to do?

    Very much appreciated.

    Rob

    Commercial tools In InDesign plugin reflective objects can do what you want. There is a free trial version, and they respond quickly to questions. It's at: http://in-tools.com/products/plugins/reflective-objects/

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • How can I count the number of participants in TextChatApp? (using SharedObject, FMS)

    Hi all.

    How can I count the number of participants?

    If the user 3animal enter the room, 3st user need to know that how many users is in the room.

    How can I find out how many users is in the room?

    Thanks in advance.

    Kevin.

    There's an sor acceptConnection() something like that on FMS, whenever you do not accept an increase in connection a counter.

    It's to you if you call all customers update handmade (custom method) so to increase counter or updating just the SharedObject that will synchronize with subscribers users.

    C

  • How can I count the fields object?

    Hello...
    I have a problem with the type of object...
    How can I count the number of fields in a generic object?

    For example, this object has 3 fields...

    Var sam:Object = new Object;
    Sam ["age"] = '2'
    Sam ['name'] = 'b '.
    Sam ['hair'] = 'x '.

    Object does not have a function like .length or similar...
    Maybe there's anithig as NumberFields(myObj:Object):int. ...
    any tips? ^__^

    Thank you very much! : D

    You can do this:

    var iCount:int = 0;
    for each (var prop in sam)
    {
    i ++ ;
    String var = sam [String (prop)] as String;
    }

  • How can I change the phone number to use Face Time?

    How can I change the phone number to use Face Time?

    Your phone number come from your SIM, and when you open a session and activate FaceTime. It should appear automatically. If it is not, then I would say that your FaceTime does not complete the activation process. If you go to settings > FaceTime, you see something awaiting activation or waiting for activation under the switch to turn it on?

  • How can I customize the toolbar when you use the browser of the attribute

    In CVI 2012, changes in the toolbar depending on the environment, for example, it is different to the source window and the user interface editor. The toolbar can be customized using the Options menu / toolbar...

    Unfortunately, when you use the browser of the attribute of the user interface editor, another toolbar is displayed, i.e. not the UI Editor toolbar... I would have assumed that the browser of the attribute belongs to the user interface editor, obviously this isn't... So, how can I customize the toolbar when you use the browser of the attribute?


  • How can I get the InDesign startup window go away when no documents are open so I can see my office? Other then having to click on the red button at the top left.

    How can I get the InDesign startup window go away when no documents are open so I can see my office? Other then having to click on the red button at the top left.

    Hello Janet,.

    Your problem could be solved if you turn off YOUR Application framework in the window Menu.

    Go to window-> part of the Application.

    Kind regards

    Aditi Simard

  • How can I change the scale when you use the measure tool

    How can I change the scale when you use the measure tool

    With the tool selected, right-click the document, and then select "rate of change of the scale.

  • I DELETED MY PDF FILES AND AGAIN USING THE RECOVERY SOFTWARE I FIND ALL MY FILES BUT NOW WHEN I OPEN FILES THAT IT SHOWS (THE FILE MAY BE CORRUPTED OR NOT SUPPORTED FORMAT.NO HOW CAN I OPEN THE FILES.) ALL OF THEM ARE MY DOCUMENTS IS VERY IMPORTANT. PLEAS

    I DELETED MY PDF FILES AND AGAIN USING THE RECOVERY SOFTWARE I FIND ALL MY FILES BUT NOW WHEN I OPEN FILES THAT IT SHOWS (THE FILE MAY BE CORRUPTED OR NOT SUPPORTED FORMAT.NO HOW CAN I OPEN THE FILES.) ALL OF THEM ARE MY DOCUMENTS IS VERY IMPORTANT. PLEASE PROVIDE ME WITH A

    Deleted file recovery can recover incomplete files, i.e. the part of these files may be missing.  Recover deleted files is much more reliable if recovery of a backup, instead of using recovery software.

    These things depend on the operating system and the file system.

    One thing, you can see: open one of these files damaged with a text editor, and then make sure that the constant % PDF is somewhere in the first 1024 bytes.

    PS please do not post ALL uppercase; It is very difficult to read!

  • How can I get the tabs colorful to use different distinct colors for 2 gmail accounts?

    Under Firefox 29.0.1 iMac OSX 10.9.3. I have multiple Google accounts: 2 1 Google Calendar and gmail accounts. Colorful tabs add-on will allow me to choose a color for a gmail account, but it also uses this same color for the other gmail account. How can I get the different colors on 2 gmail accounts?

    In addition, colorful tabs is also the same for my homepage (google.com) and my google calendar. How can I get different colors on these 2?

    Personally, I use 'Fabtabs' for my mozilla FireFox.

    https://addons.Mozilla.org/en-us/Firefox/addon/FabTabs/

    This add-on has problems like that when I use it.

  • How can I filter the noises of thermocouple using a TC-2095 and SCXI - 1102c?

    Hi all

    I currently have four TC - 2095 s connected to the SCXI - 1102c inside an SCXI-1001 chassis cards. These thermocouples are floating and I get a good amount of noise (400 Hz 3 phases and same 60 Hz noise) when we turn on some equipment such as fans, and fans. Using this current set up, how can I filter the noise? Or I would need to put in place a new hardware configuration (e.g., the SCXI-1102 cards)?

    Hi RALoo,

    The 1102 C has a lowpass filter with a cutoff at 10 kHz frequency, so you will not be able to filter into the material with your current configuration.

    Your first option is to use a software filter.  LabVIEW has several functions that do this. More information can be found here: http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/filter_vis/

    The second option would be to change to SCXI 1102 cards as you suggest.  The low-pass filter of the 1102 was a cut-off adjustable to 2 Hz frequency, which will stop the noise of 400 and 60 Hz don't affect your readings.

  • How can I include the picture number when using 'Export Frame'?

    IM using the button at the bottom right of the Panel of reading called "Export".  That's exactly what I need, but I have a lot of unique need frames and image export. How can I get the name of the file to include the image at the end of the file name automatically?

    For example, instead of her show "Séquences 01.Still001" by default.  I want to only show 'Séquence 01_0001' let me know what framework 0001.

    It's possible, correct?

    If you export the timeline, you get the number sequence timecode.

    If you Match Frame and export of the Source monitor, you get the timecode of the video under the number.

  • How can I count the custom order?

    I'm counting the number of names that appear in all the columns in the table

    Each cell contains the name of a single individual, like the first column: 1-01, the second columns: 1-02, etc.

    Can someone help me with the formula to measure? What would be the correct formula for this?

    Thank you very much.

    Hi the learner,

    "I'm trying to count the number of names that appear in all the columns in the table

    Each cell contains the name of a single individual, like the first column: 1-01, the second columns: 1-02, etc.. »

    Your goal is not clear.

    What do you mean by ' count number per ordercustom?

    You want a single indictment which only has the names that appear in each column?

    Do you want counts of the number of names appearing in each column (ie. a separate head for each column)?

    You want a counter of the number of all the names on the table?

    Or is that what you want different from all this?

    "Each cell contains the name of a single individual."

    Not mean there is no empty cell?

    This means that there are no cells that contain data that is not the name of an individual?

    I do not understand the connection between "1-01", "1-02 ' and the names in the cells.

    Please specify.

    Kind regards

    Barry

  • How can I count the pulses in a channel?

    Hello

    I have a channel consisting of 0 and 1 (data comes from a proximity sensor) and I was wondering if there is an easy way to count the events (i.e. pulse) to (Advanced) Tiara? At its simplest, I just need a method to count the number of rising edges in the channel.

    A script would be the way to do this? If so, is there any example autour code to demonstrate how to analyse the lines in a channel?

    Thank you

    PorridgeMan.

    Hello!

    @Martin: IMHO your aproach can operate, but need not because of input data and the right compares value (10 in your case).

    If the input data are not a pure 0-1 step you can get more the a value greater than 10 for a rising edge.

    The comparison value depends on the distance of time and the channel values, and it's not easy to calculate in advance.
    The other drawback I see is that you need a channel of X, which is not really necessary to solve the problem.

    I think my code will be more robust (IMHO as I mentioned).

    @PorridgeMan: Yes, it's a shame it takes certain steps of DIAdem to solve this common problem.

    First: By script is possible, but generally to slow down. My approach is to insert a 0 value at the beginning

    a copy of the input channel table and compare it to the input string. If a value is less than 0,5 (half of you maximum values)

    and the other is higher I put a 1 0 otherwise in a result string. Even in more complicated cases, the comparison value could

    be calculated or alienated by a moving average.

    Here is the code:

    Option Explicit
    
    ' Copy data
    Call ChnCalculate("Ch(""[1]/Dif"")=Ch(""[1]/Pulses"")")
    ' Insert one 0 at the beginning
    Call DataBlInsertVal("[1]/Dif",1,1,0,0)
    ' Compare and convert result to 1 or 0
    Call ChnCalculate("Ch(""[1]/Result"") = IIf((Ch(""[1]/Pulses"") < 0.5) And (Ch(""[1]/Dif"") > 0.5), 1, 0)")
    ' Sum is result
    Call MsgBox(Cch("[1]/Result",4))
    

    Hope this helps

    Matthias

  • How can I disable the "red mask" while using the gradient filter...

    When I use the gradient filter, the red mask appears indicating where the setting will be affected... but I can not disable it to view the live settings, while I make adjustments to settings...

    How or where can I find the switch to turn off the "red mask"?

    Press the 'o' for overlay power

Maybe you are looking for