extraction of the page numbers for the XML export

Hi all

I export XML for InDesign CS4 book layout, and I need to have page numbers associated with tags as an attribute.

Whenever the style "Heading 1" appears in my layout, it will run a script to determine that the title is on the current page and create a new attribute.

(for example, < heading1 pagenum = 32 > it as a header < / Heading1 >)

I think that this could be part of the code that would capture the current page.

http://forums.Adobe.com/thread/451546

.. .and the 'MakeXMLAttribute' in the Guide from JS Adobe can be fundamental to create attributes for each topic.

Heavy goods vehicles that can help you with this?

If you have any ideas, could you send along?  Very much appreciated.

I'm so sorry, guys. Not one, but two major mistakes! (And for some reason any both 'enable' in CS4, but not in CS).

Here's a version better:

markHeaders (app.activeDocument.xmlElements[0]);
function markHeaders (rootElem)
{
  var a;
 if (rootElem.markupTag.name == "heading1")
 {
 // if (confirm (rootElem.markupTag.name+"\nContinue?")==0) exit(0);
 // if (confirm (rootElem.markupTag.name+"\n"+rootElem.lines[0].contents+"\nContinue?")==0) exit(0);
  try {
   rootElem.xmlAttributes.add ("pagenum", rootElem.characters[0].parentTextFrames[0].parent.name);
  } catch (_) { alert("wot? "+rootElem.lines[0].contents+"\n"+rootElem.characters[0].parentTextFrames[0].parent.name); exit(0);}
 }
 for (a=0; a

First thing I did was disable the try... catch that handles errors, so I could see what went wrong. It was kinda a 'Oh' - I used parentTextFrame, rather than parentTextFrames [0] (error of version control and the boy, I should have watched out for these!).

The second was more subtle: the script stopped after processing 2 headers, "Atrribute already exists." That has had a bit of debug step by step, until I noticed that I used the variable 'a' a loop... inside a function called... so the variable gets reset and starts again at 0... all... time... his... name... Calling themselves functions are called 'recursion', and now I know where he got that name (I've cursed and re-cursed until I finally got to work).

Good news, it is this script still is blistering fast - now it works finally.

Tags: InDesign

Similar Questions

  • Many sheets in Excel to PDF conversion - page numbers for all the leaves, not individual leaves

    I need to convert the number of sheets in Excel in a single PDF file.  If I select each sheet with a personalised décor, page numbers for this journal (1 of 10) (1 of 5), etc.  When I select multiple sheets, the page numbers through the leaves.  Instead, it is from 1 to 15.  Make sense?  How can I tell Adobe to let alone individual page numbers?  Thanks for your help!

    Hi Penny,

    This feature has been changed to provide the same page, numbering of the Excel experience provides when you print your workbook or worksheets to other printers.

    It is possible to convert each worksheet as a PDF and then combine these PDFs resulting. Who will provide the numbering of the page that allows you to get.

    Making the print-to-pdf and then combine is to use Ribbon Excel PDFMaker "Create PDF and perform the Action" button.

    You can create an Action that uses the functionality of harvesters or Acrobat watermark to add page numbers as you wish.

    Kind regards

    Charlene

  • Notes - restart page numbering for each chapter (workaround)

    Hi all

    As far as I know, there is no way how to reset the reference numbering in ID CS4 (it would be ideal to have any possibility to choose the paragraph style, which could rely on that). Available only three options are available for the reset, all IMHO quite useless for documents faces double - pages numbered page and division (I located him so the names may differ). My chapters always starts on the front page. If the individual "divisions" would be created for each chapter and reset at the beginning of each division, as the division starts on the back page! (cannot be changed), it resets the previous chapter reference numbers, if they appear on this page at the back. But I agree that for documents single side, this option would be sufficient for me.

    Is there no workaround solution how to restart notes with each chapter numbering in the double faces documents? It could be scripted? I really need it...

    Kind regards

    Jan

    Hang on, I think I got it.

    When you're paging the regularly in your document, you use Alt + Pg. Prev / Alt + PgDown (Previous Spread) InDesign always selects the current spread. When you use SHIFT + PG. PREC and Shift + PgDown screen irritating jumps from the left to the right, so I do not use it, but it's the right page selected in the Pages panel.

    The difference is, when propagation is selected in the Pages panel, the new Section is automatically applied to the first (= left) page in which spread.

    If you right click on the page in the Pages panel, where do you want to actually start the new section, it will always apply to the correct. (And if you're a keyboard jockey, first navigate to the correct spread, then press on shift + page down once to get the point on the right page-- right.)

  • How we can print the page numbers for the shape of the TABLE OF CONTENTS when her excluded from the form page count?

    Hi Experts,

    We have the TABLE OF CONTENTS, followed by 100 forms totally 215 pages.

    We checked in the exclusion of the option of number of form page SUMMARY form at the level of the group.

    Followed forms of TABLE OF CONTENTS forms all use FORMSETPAGENUM rule at the bottom of page.

    the first form followed by TABLE OF CONTENTS form the number starts page 1 of 215 and the last form closes at 215 215.

    Now, I want to print the Page number of SUMMARY form only.

    How can do us?  Any thoughts?

    Kind regards

    RAMAN C

    Hello Raman,

    I guess that you included "Exclude the number of pages" option in the form of table of content (TOC).

    There is a limitation in the studio. The functions of page number (PAGE NUM OF FORM / FORMSET PAGE OF NUM) will be ineffective when we choose the option "Exclude the number of pages" in the form of table of contents. Therefore, you was not able to print many pages of form as a table of contents.

    The only way to print the number of pages is to deselect the option "exclude the number of pages. Then you can print the number of pages in the table of contents in the form of table of contents normally. However, this number of pages in the table of contents will add to the Total number of pages form set. The number of pages all forms can be controlled by Postransdal using the script [FORMSET PAGE NUM = TotalPages() - 1]

    Kind regards

    Mahesh

  • I can not display the page numbers of my books

    I want to sort my books pdf by number of pages, but when I add this detail (Pages) in the folder the whole column is empty.

    How can I get page numbers to display?
    I tried the following far with the following results:
    1. the folder does not give me the ability to edit the details of the file when I right click on it so I can't enter the page numbers manually.
    2. when I right click and check the properties of the available tabs are general, sharing and customize.  Customize tab only allows me to change the folder icon.
    3 when I select the properties of one of the pdf books in the folder tabs only I get are general, Pdf, and resume and I am unable to add the page number, use one of these tabs as well.
    4. I downloaded 'Quick pdf tools' that allows me to be able to change the pdf information because I thought that the reason why the column is empty is because the PDF itself does not page number filled in, but by viewing the properties with this tool, I am able to see that the page numbers for all the pdf files are listed (and can not be changed) so I don't understand not why the column for pages shows blank in the windows folder.
    What I resorted to that adds the keywords column to the file and write the page numbers in this column because the information I enter in this field will appear in the windows folder column.  I have a number of books, and it's a little disheartening to think that I must do this for each book when the information is already there for example the page number.
    So, if anyone can let me know what I can do to make the Pages column displays the number of pages rather than remain just an empty column, I would be very grateful.

    See if the following help to view pages:

    1. in a folder, choose 'View' - 'choose details '.

    2. a dialog box "Choose details" will appear. From there, you will have many options, listed here in alphabetical order:

    * Title of the album
    * Artist
    * Attributes
    * Audio sampling rate
    * Audio sample size
    * Author
    * Flow
    * Camera model
    * Category
    * Channels
    * Comments
    * Company
    Author's rights
    * Date of access
    * Date of creation
    * Update
    * Date photograph
    * Description
    * Dimensions
    * Duration
    * Name of the episode
    * Version of the file
    * Type
    * Keywords
    * Name
    * Owner
    * Pages
    * Product name
    * Product version
    * Description of the program
    * Protected
    * Size
    * Status
    * Topic
    * Title
    Track number
    * Type
    * Year

    Naturally, some of these options do not make sense for all folders. But for those who have a sense, check the boxes next to the details you want to see.

    If you want to move an element upwards or downwards in the list (higher appear to the left in "Détails" view), click on the item in question and press the 'Move up' and 'down '.

    I hope this helps.

  • Page numbering and the Table of contents

    I have a book containing 23 document files. Document files contain the page numbers in the footer.

    One of the document file is a generated table of contents (TOC). Unfortunately, the generated page

    the number in the table of contents do not match the numbering of the pages in the files. Here are the details:

    • The title page, in a file by itself, is not numbered
    • The frontmatter, distributed in five cases use lowercase Roman (i - xvi)
    • The body of the text in the remaining 17 files is digital (1-243)
    • The generated TOC uses cardinal numbers of the book as a whole. For example,.
      Chapter I is numbered correctly in the footer from page 1. However, he is listed in the table of contents
      as starting on page 19, because this is the file real 19th in the book. I put the document numbering
      This file from 1 properties and properties of Page numbering for the book as a whole to
      be "continue."
    • The style of the table of contents entries is correct. In other words, the frontmatter uses a tiny Roman and the
      chapters use Numeric

    I tried to regenerate the table of contents, but this did not help.

    Does anyone have suggestions on what is the way prescribed to do?

    OK, I continued to read and this is what I found:

    Set the numbering style in the document, and not in the book that we told you. Format > Document > numbering. Choose Arabic or digital. Repeat for the various chapters.

    Save and close the chapters. In the book file, click with the right button on each chapter and choose Configure XXX. This is where tell you the book to continue the page numbering or restart at the 1.

    Once this is done, update your address. From there, if there are issues, we rely on the logic of the Fm we use every day, and each of us can help you solve.

  • FM 10 - How to set up the Roman numeral page numbers in the preface?

    I want to use the Roman numeral page numbers in the preface, but normal numbers in the document (not the book).  How can I set up a "first pages" section for the Roman numerals?  Using FM 10

    I master the basics of the (and more) of Adobe FM 10, by Janet Underwood, but don't find anything in there that helps.

    Yours, Earle Fox

    Do the preface of a separate in the book file. In the book window.

    Right click on the file of the preface and choose numbering. On the Page tab.

    First Page # 1 value and Format "Roman (xiv)." Click on define.

    If you after the chapters where you also want to use the Roman

    numbering, click 'continue Page numbering in previous book.

    button instead.

    To return to normal of the numbering, choose the first file and the value

    First Page # 1 and the Format to "Numeric" (14) Set the following to files

    'Continue the numbering from the previous Page in the book.'

    Parameter page numbers for the books in the book window usually gives better

    the results, but you can also configure it for each document, from the inside of the

    document. (Format > Document > numbering), then, using the book window

    dialing, assign each file read file in the tab of the page.

  • I have a Macbook Pro (13 - inch, Mid 2012), processor 2.5 GHz Intel Core i5, memory 4 GB 1600 MHz DDR3 and the serial number C1MK12K6DTY3. On the Pages, Numbers and Keynote, y at - it any other way to get them for free?

    I have a Macbook Pro (13 - inch, Mid 2012), processor 2.5 GHz Intel Core i5, memory 4 GB 1600 MHz DDR3 and the serial number C1 * TY3. On the Pages, Numbers and Keynote, y at - it any other way to get them for free?

    < personal information under the direction of the host >

    Only when you buy a new Mac. Since the end of 2013 the app came with the purchase of a Mac.

  • the font size for the page numbers in the index

    I use 10 FM, creating an index for a book.  I can adjust the font size for the text down to 9 points, but page numbers are stuck at 12 points.  I can do 9 point individually, but they return to 12 points, when I save the book.  What should I do to get page numbers to stay in the point 9?    The same thing happens if I use the character or paragraph Designer.

    Earle Fox

    In the ... IX.fm file, what are the attributes of the tag IndexIXpara font by default ?

    No chance that they have been rejected by a character Format or a simple substitution of element prototype <$pagenum> on The IX reference Page?

  • I can't find the serial numbers for my CS3 and Photoshop CS5 on the page my Adobe products. I registered these past two years

    I can't find the serial numbers for my CS3 and Photoshop CS5 on the page my Adobe products. I registered these past two years. Kenneth Robison

    Contact adobe support by clicking on this link then "still need help" as soon as it appears, https://helpx.adobe.com/contact.html

  • How to adapt the script to a Jongware for page numbers?

    I have an index where

    Anne, 3, 5

    Mary, 11, 23-24

    and converted with the script (for example by adding + 4) does not affect the numbers of hyphen:

    Anne, 7, 9

    Mary, 15, 27 -24

    required: Marie, 15, 27-28


    I assumed that the second hyphen with grep of marking + character style could mark a step, but the script asks to select ALL the text.

    May be an idea to change the script runs in a second time with these numbers given the style of character or color?


    DESCRIPTION:omg page numbers are all wrong!

    A Jongware Script 18 -Aug- 2010

    If (app.documents.length == 0)

    {

    Alert ("Oh give me a text to play with :'(");

    Exit (0);

    }

    If (app.selection.length! = 1).

    {

    alert ('we cannot go on like this. Select some text first. ») ;

    Exit (0);

    }

    myDialog = app.dialogs.add ({name:'omg the numbers are wrong!',canCancel: true});

    with (myDialog)

    {

    with (dialogColumns. add())

    {

    with (dialogRows. add())

    staticTexts.add ({staticLabel: 'firstly to change'});

    with (dialogRows. add())

    aBox = integerEditboxes.add ({editContents: "1"});

    with (dialogRows. add())

    staticTexts.add ({staticLabel: "last change"});

    with (dialogRows. add())

    bBox = integerEditboxes.add ({editContents: "99999"});

    with (dialogRows. add())

    staticTexts.add ({staticLabel: "Add or subtract this value"});

    with (dialogRows. add())

    cBox = integerEditboxes.add ({editContents: "2"});

    }

    }

    If (! myDialog. show())

    {

    myDialog.destroy ();

    Exit (0);

    }

    first = aBox. editValue;

    last = bBox. editValue;

    step = cBox. editValue;

    If (first < 1 | first > last | step == 0)

    {

    Alert ("now you're pulling my nose arentya");

    Exit (0);

    }

    approx.findGrepPreferences = null;

    approx.findGrepPreferences. findWhat = "\\b\\d+\\b";

    list = app.selection [0]. findGrep (true);

    changes = 0;

    for (i= 0; I< list.length; i++)

    {

    n = number (.silence list [i]);

    If (n > = first & & n < = last)

    changes ++, list .silence [i] = String (n+ no);

    }

    Alert ("number of changes:"+ changes ");

    My godness, is perfect.

    This formula of Grep is a piece of cake!

    Example of fake tie is nonsense, but the solution is real.

    Thank you very much.

    My Monday will begin happy benevolence.

  • Page numbers in the XML report

    Dear members,

    I use Oracle Applications V 11.5.10.2, Microsoft Office 2010 and the XML editor.

    I have developed an XML report.

    In this report, I want to display the sub areas:

    1 / Page numbers
    2 / report Date

    Can someone let me know how to achieve this.

    Thanks in advance.

    Best regards
    Arun D. Reddy

    Published by: A4S on June 8, 2010 07:31

    Hello

    I've sent the updated file to your ID. Have a look at.

    Thank you.

  • FrameMaker2015 - Page numbers in the mess after the printing of 'last leaf' first.

    There seems to be no facility to reverse the order of page numbers when creating long Arabic & Hebrew documents and where the pages are to be attached at the end of a series of normal pages left to right .

    I was hoping this would be an automatic feature - for executives of 8-12 in Arabic, I had to save the document to the Mif and run a VERY complex program that extracts the folio box and puts managers folio on pages of body that then let me reverse the order of page number to hand.

    Bob

    Post edited by: Bob Wallace to change from RTL to LTR

    I think that you have to maintain the FM document sequentially even for Arabic pages i.e. Page 91 should be the first page of Arabic and so on. Now the booklet and PDF can be generated as follows:

    • When the booklet, you can select 'last leaf first' to Arabic range(91-100), and this page can be added with the other pages(1-90) LTR. For the booklet page numbers would look like 1, 2, 3... 90, 100, 99... 91 and so when the Arab user would read the Arabic content in the booklet, he would begin reading the content of page 91 and for him that the page number would increase also 91 to 100, he was reading.
    • For the PDF, you can directly generate the PDF file.

    Let me know if that makes sense.

    Thank you!
    Hard

    FrameMaker engineering

  • Get the channel search page numbers

    I've found that I can match a Word and get its page number by making a loop through the numPages, numWords using getNthWord, but I need to get a whole sentence like "api reference".

    The goal is that I need to extract some pages that contain certain phrases. My thought was to find, record page numbers, then extract and save.

    V7 + using all the search.query the search plugin (great search pane) and if you hover over every game it will tell you the page it's on, so I know the data is there. But after scouring the api, I can't seem to find something that could help.

    Here is my current idea, but as you can surmise for documents more large it takes a terrible time long:

    var extrList = [];
    searchIt ("indicate by check");
    App.Alert (extrList)


    function searchIt (srchStr) {}
    var ckWord, numWords;
    var tmpArr = srchStr.split("");
    var tmpArr.length = tmpLen;
    for (var i = 0; i < this.numPages; i ++) {}
    numWords = this.getPageNumWords (i);
    for (var j = 0; j < numWords; j ++) {}
    ckWord = this.getPageNthWord (i, j);
    for (var t = 1; t < tmpLen; t ++) {}
    If (j + tmpLen < numWords) {/ / check out of bounds}
    ckWord += "" + this.getPageNthWord (i, j + t)
    }
    }
    If (ckWord == srchStr) {}
    extrList.push (i)
    } / / end of equality so
    } / / end numword for
    } / / end numpage for
    }

    I guess my question is, is there a better approach for the search expression page numbers?

    Thank you.

    Can't answer your question directly, but I can tell you that it is possible

    use getNthWord to match a sentence. Basically, you need to do what you were doing

    so far (a double loop to find the first word in the sentence), then

    continue the corresponding words. If you match all of them, you can a

    positive match. It's complicated, but doable.

    For example, I just did that in this script, which highlights all instances

    of a word or phrase in a file:

    http://try67.blogspot.com/2008/11/Acrobat-highlight-all-instances-of.html

    Edit: Didn't see the code when I posted this... It seems that you got the hang of it.

    I don't know any other way to do this with a script.

  • I would use Yuanti SC police for my web development project. However, my developer is not able to use the file .ttc I extracted from the library of fonts, and .ttf, .otf .woff formats not available anywhere on the web.

    I would use Yuanti SC police for my web development project. However, my developer is not able to use the file .ttc I extracted from the library of fonts, and .ttf, .otf .woff formats not available anywhere on the web. Please, let me know how can I use this font for my project.

    Thank you

    Anton

    Unless the site you develop is for the Asian market, I don't know why you want to use that particular font. The Basic, standard and digital alphabet punctuation glyphs has sans serif, Roman characters, but the rest is thousands of Kanji characters. While you can use the font .ttf and .otf and web fonts, it would be very unusual to use one so great. Pages should load quickly and 78 MB, with a value of faces to download for those who have connections slow Internet is not fast.

    I would take a different font without serifs. There are literally thousands who look identical or virtually identical to Yuanti.

    131 free and high quality without font serif to choose here. I'm sure you can find a desired.

Maybe you are looking for

  • Formula to determine if a specific day of the week between two dates?

    I am creating a spreadsheet to track my time PD & holiday. I usually work weekends, and my vacation allowance includes a specific maximum number of Sundays a year. Is there a way to calculate how much Sunday fall between a date range (or any day of t

  • HELP with Scan string timestamp

    Hi all I'm having a little problem here. I have a text file containing statistical data and I need to sync it with other data. To do this, I want to put stamps on each line of data. Right now I have the time in the format 04/07/12 09:05 p So you can

  • HP 14-d008au: 14-d008au issues of driver on windows 7

    PCI\VEN_168C & DEV_0036 & SUBSYS_217F103C & REV_01 PCI\VEN_168C & DEV_0036 & SUBSYS_217F103C PCI\VEN_168C & DEV_0036 & CC_028000 PCI\VEN_168C & DEV_0036 & CC_0280 Mr President it is the missing drivers hardware ID

  • Reinstallation of Windows XP Edition family

    Hello Rebuilt computer, new motherboard, memory, CPU etc. Disc booted XP has been changed but wasn't happy so saved 'My documents' and decided to do a reinstall. All is well until the key entering the stadium. I have the key disc number and honest, b

  • Cannot change the internet homepage

    Original title: group policy I have a computer at home that has all of a sudden wouldn't let me change my internet homepage.  She says that it is managed by the administater.  I am the administrater on my computer.  I'm not part of any network.  What