PDF to InDesign script for FOLIOs

I have a number of back issues in which I wish to convert to digital using DPS. So I found this script that will save me weeks worth of work.
http://www.adobe.com/devnet/digitalpublishingsuite/articles/dps-pdf-to-indesign.html
I am working with a 112 page magazine + cover.
When I limit the magazine down to 8 pages, this script works like a charm.
However, whenever I work with anything beyond 8 pages, the page orders go completely out of whack, the script doesn't import some pages and it's a mess.
I tried to reply to post a comment on this page, as others have done, to get in touch with the programmers who help people like me, but the page keeps saying sign in to post a comment - and I am already signed in and it won't let me post anything, no matter what browser I'm using.
I'm hoping someone can help me here.
Thanks.

Working with Derek directly did the trick!
The difficulty with the script is that it requires everything to be in "alphabetical order." What that means is that when you split the files in Acrobat into individual PDFs, everything needs to be in "alphabetical order" and Acrobat does not do that the way this script requires.
So Acrobat gives me 1_ISSUE24.pdf, 2_ISSUE24.pdf and if I had 9 pages, that wouldn't be an issue. But I had over 200 pages for a specific issue and when you get to page 10, you're no longer working in alphabetical order if the single page numbers don't have a 0 in front of them.
So if you have up to 99 pages, make sure every page with a single page number has a 0 in front of it, e.g. 01_ISUEE24.PDF
If you have up to 999 pages, make sure every page with a single page and double page number has two 0's in front it., e.g. 001_ISSUE24.PDF
Unless there's a program out there that will automatically put 0s in front of filenames for you, you have to do this manually, which is slightly time consuming. FAR LESS time consuming, however; than re-sizing everything yourself and doing this the old fashioned way with cut and paste, etc. etc. etc.
So the script is extremely helpful, it's free - you just have to have your page numbers numbered correctly.
Thank you, Derek, for your time and your help.

Similar Messages

  • Creating folios for iphone using a pdf-to-indesign script

    Hello, i need to convert all my magazines to iphone format. Someone can help me with the script using pdf-to-indesign for IPHONE? Or an alternate solution to convert all my magazines (1024 x 768) to Iphone (480 x 320)? Thanks a lot!!

    Working with Derek directly did the trick!
    The difficulty with the script is that it requires everything to be in "alphabetical order." What that means is that when you split the files in Acrobat into individual PDFs, everything needs to be in "alphabetical order" and Acrobat does not do that the way this script requires.
    So Acrobat gives me 1_ISSUE24.pdf, 2_ISSUE24.pdf and if I had 9 pages, that wouldn't be an issue. But I had over 200 pages for a specific issue and when you get to page 10, you're no longer working in alphabetical order if the single page numbers don't have a 0 in front of them.
    So if you have up to 99 pages, make sure every page with a single page number has a 0 in front of it, e.g. 01_ISUEE24.PDF
    If you have up to 999 pages, make sure every page with a single page and double page number has two 0's in front it., e.g. 001_ISSUE24.PDF
    Unless there's a program out there that will automatically put 0s in front of filenames for you, you have to do this manually, which is slightly time consuming. FAR LESS time consuming, however; than re-sizing everything yourself and doing this the old fashioned way with cut and paste, etc. etc. etc.
    So the script is extremely helpful, it's free - you just have to have your page numbers numbered correctly.
    Thank you, Derek, for your time and your help.

  • [JS][CS5] Enhancing Section 508 accessibility of pdfs from InDesign script

    I was using a script to automate mapping styles to tags and tagging graphics as artifacts or as figures with Alt attributes for section 508 accessibility reasons, but in order to encourage use by designers, I wanted to add code to unlock all locked items in the document and then relock those items before the end of the script. Otherwise, the script would hang up when it encountered a locked item. I have an approach that seems to work, but is there a more elegant way of handling the locking and unlocking, especially for anchored and inline graphics?
    Also, if anyone finds this code useful, I'd appreciate any feedback based on your use of it.
    Preps an InDesign document for pdf output that is closer to section 508 compliancy.
    This script acts on the active InDesign document. It removes any unused tags from the tags palette. 
    It unlocks everything that is locked.
    It creates all necessary tags in the tags palette if they do not already exist.
    It tags all untagged, placed graphics as either Artifacts or as Figures as follows:
    Any graphic on a master page is tagged as an artifact.
    Any graphic with a file name that contains either of two 4-character sequences, “art_” or “_art” (case insensitive) is also tagged as an artifact.
    All other untagged graphics are tagged as figures and assigned an Alt attribute.
    Graphics appearing on publication pages (not master pages) that were tagged prior to running the script will have an Alt attribute added to the pre-existing tag if it does not already have one.
    The script relocks everything that the script previously unlocked.
    It removes any existing styles-to-tags mappings.
    It creates new styles-to-tags mappings for all paragraph styles based on the following paragraph style naming convention:
    Every paragraph style is mapped to the P tag, unless the style name contains a prefix, suffix, or infix matching the format H2_ or _H1 (underscore character optional) 
    where the numeric digit indicates the level in the document hierarchy for the headings to which the style is applied.
    Paragraph styles with names containing H1, H2, H3, H4, H5, or H6 are mapped to tags with those names.
    The script then maps paragraph styles to tags based on the newly created mappings.
    THIS SCRIPT IS MADE AVAILABLE ON AN "AS IS" BASIS,  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    #target "InDesign-7.0" //for InDesign CS5
    var markup_tag_names = new Array( "H1","H2","H3","H4","H5","H6","Figure","P","Story","Article","Table","Cell","Artifact");
    var re_artifact = new RegExp("(ART_)|(_ART)", "i" );
    var re_heading = new RegExp("(H[1-6]_?)|(_?H[1-6])", "i" );
    var arraysAnchoredInlineGraphicsLockStatuses = new Array();
    var d = app.documents[0];
    d.deleteUnusedTags();
    var arrLayersLockStatuses = d.layers.everyItem().locked;
    var arrPageItemsLockStatuses = d.pageItems.everyItem().locked;
    for (var k  = 0; k < d.stories.count(); k++ ) {
        arraysAnchoredInlineGraphicsLockStatuses.push( d.stories[k].pageItems.everyItem().locked );
    d.layers.everyItem().locked = false;
    d.pageItems.everyItem().locked = false;
    d.stories.everyItem().pageItems.everyItem().locked = false;
    for ( var i = 0; i < markup_tag_names.length; i++ ) {
         zTag = d.xmlTags.itemByName( markup_tag_names[i] );
         if ( zTag.isValid ) continue;
         else d.xmlTags.add( markup_tag_names[i] );
    var p_tag = d.xmlTags.itemByName('P');
    var figure_tag = d.xmlTags.itemByName( 'Figure' );
    var artifact_tag = d.xmlTags.itemByName( 'Artifact' );
    var root = d.xmlElements[0];
    for ( var i = 0; i < d.allGraphics.length; i++ ) {
         g = d.allGraphics[i];
         pg = g.parentPage;
         if ( pg == null ) continue;
         isOnMaster = pg.parent.constructor.name == 'MasterSpread';
         if ( g.itemLink.isValid != true ) continue;
        fname = g.itemLink.filePath;
        fname = fname.substring( fname.lastIndexOf(':') + 1 ); //Mac-specific folder separator ':'
         if ( g.associatedXMLElement == null ) {
            if ( isOnMaster )  {
                root.xmlElements.add( artifact_tag, g );
            else  if (  re_artifact.exec( fname ) != null ) {
                root.xmlElements.add( artifact_tag, g );
            else {
                xmle = root.xmlElements.add( figure_tag, g );
                xmle.xmlAttributes.add('Alt', '' );
         else if ( ! ( g.associatedXMLElement.xmlAttributes.itemByName('Alt').isValid ) && !(isOnMaster ) ) g.associatedXMLElement.xmlAttributes.add('Alt', '' );
    for (var k  = 0; k < d.stories.count(); k++ ) {
        if ( d.stories[k].pageItems.count() > 0 ) {
            for ( var z = 0; z < d.stories[k].pageItems.count(); z++ ) {
                d.stories[k].pageItems[z].locked = arraysAnchoredInlineGraphicsLockStatuses[k][z];
    for ( var i = 0; i < d.pageItems.count(); i++ ) {
        d.pageItems[i].locked = arrPageItemsLockStatuses[i];
    for ( var i = 0; i < d.layers.count(); i++ ) {
        d.layers[i].locked = arrLayersLockStatuses[i];
    d.xmlExportMaps.everyItem().remove();
    for ( var i = 0; i < d.allParagraphStyles.length; i++ ) {
         var psty = d.allParagraphStyles[i];
         var rslt = re_heading.exec( psty.name);
         if ( rslt != null ) {
              rslt = rslt[0].replace("_", "");
              rslt = rslt.toUpperCase();
              d.xmlExportMaps.add( psty, d.xmlTags.itemByName(rslt) );
         else { d.xmlExportMaps.add( psty, p_tag ); }
    d.mapStylesToXMLTags();

    Are you running this in a persistent engine?
    Have you tried wrapping the myDisplayDialog() call in a try/catch block to see if it is throwing an error?
    I can provide all the relevant scripts if necessary, but they're pretty convoluted. The most important one is the user input function. Here it is:
    It's quite common that the convolutions are related to the problem. A good exercise is narrowing it down to a small reproducible test case without the convolutions, and often as not you may find the problem in the process. If not, well, at least you'll provide something to test with.

  • Indesign Script for placing excel-file

    Hi all, I'm new to Indesign Scripting, and I'm hoping someone can help me with the following code:
    All I want to do is:
    open indesign file
    open excel file
    place excelfile as a table (with flow enabled)
    save document & export as PDF
    Thanks!
    //Define file to open
    var myDocumentFile = new File("/d/Projecten/Indesign Server/document.indd");
    //Define file to save
    //var mySaveFile = new File("/d/Projecten/Indesign Server/document_save.indd");
    //Define file to export
    var exportPDF = new File("/d/Projecten/Indesign Server/document_save.pdf");
    //Open xls-file to place as table
    var myExcelFile = new File ("/d/Projecten/Indesign Server/products.xls");
    var result = "";
    if(!myDocumentFile.exists) {
        result = "Unable to find DOCUMENT:  " + myDocumentFile.path;
        $.writeln(result);
        exit();
    } else if(!myExcelFile.exists) {
        result = "Unable to find EXCEL:  " + myDocumentFile.path;
        $.writeln(result);
        exit();
    } else {
        // Open file
        var myDocument = app.open(myDocumentFile);
        with(app.documents.item(0).pages.item(0)){
            myTarget = textFrames.item("tabel");
        var myPage = myDocument.pages.item(0);
        //Set excel placement properties
        setXLimportPrefs();
        // Place Excel file
           try {
                 $.writeln("Place Excel file");
                //HELP!! HOW TO PLACE EXCEL FILE?
                //myTextFrame.place(myFile);
            catch (e) {
                 $.writeln("Place Excel file "  + e + " " + app.excelImportPreferences.errorCode);
                myDocument.close();
                exit();
        if(!exportPDF.parent.exists && !exportPDF.parent.create()) {
            result = "Not exported.  Unable to create the folder:  " + exportPDF.parent.fullName;
            $.writeln(result);
        } else {
            app.documents.item(0).exportFile(ExportFormat.pdfType, exportPDF, app.pdfExportPresets.item("[Press Quality]"));
        myDocument.exportFile(ExportFormat.PDF_TYPE,exportPDF);
        myDocument.close();
    function setXLimportPrefs(){    $.writeln("setXLimportPrefs()");
            with(app.excelImportPreferences){
                //alignmentStyle property can be:
                //AlignmentStyleOptions.centerAlign
                //AlignmentStyleOptions.leftAlign
                //AlignmentStyleOptions.rightAlign
                //AlignmentStyleOptions.spreadsheet
                alignmentStyle = AlignmentStyleOptions.spreadsheet;
                decimalPlaces = 4;
                preserveGraphics = true;
                //Enter the range you want to import as "start cell:end cell".
                rangeName = "A1:B16";
                sheetIndex = 1;
                sheetName = "Appetizers";
                showHiddenCells = false;
                //tableFormatting property can be:
                //TableFormattingOptions.excelFormattedTable
                //TableFormattingOptions.excelUnformattedTabbedText
                //TableFormattingOptions.excelUnformattedTable
                tableFormatting = TableFormattingOptions.excelFormattedTable;
                useTypographersQuotes = true;
                viewName = "";
    result;

    "I just loaded a table into a text frame but it still contains nothing". I wonder how I'd check that, actually.
    @Jongware:
    To prevent this situation you could set the max. allowed cell height below your min. text frame height.
    If this is not applicable, because in some situations you cannot know the usable text frame height beforehand, you can iterate through all your set rows and check if the parentTextFrames[0].parentPage.name property of the first insertionPoint of its first cell is defined. If it's undefined and your last text frames parentPage.name is not equal to the last defined parentPage.name of your check your table will remain overset.
    Thinking about that method I must admit, that you can get a false positive, if a text wrap object on an applied master page comes into play…
    So no, I see no fail-safe check for this situation.
    Uwe

  • Indesign plugin for folio

    Hello,
    I have one tricky question on you. Iam developing plugin for InDesign, this plugin adds some functionality to indd file, this file is uploaded into cloud and folio is created. Folio is loaded to device (eg iPad, which is connected thru wifi to internet) and now i need this: when the button in folio is pressed i need to send http request on my server with ID of iPad. Is it possilbe to achieve this, by any means necessarry? (I have bad feeling that this couldn't be done... )
    Thank you in advice
    Kind regards
    Ondrej

    Hi Bob!
    I´ve download the full install of the Folio Producer yesterday. Installed it (and i replaced the old Drop11 stuff)
    And then i login to the "Folio Builder" with my Adobe ID (later i will login with my commercial client account right?).
    Where is the part where i produce/export a Folio-file? Or it doesnt work that way anymore?
    http://help.adobe.com/en_US/digitalpubsuite/using/WS9293e1fb3b977c5c7b1f65ad12f28224932-7f ff.html#WS9293e1fb3b977c5c7b1f65ad12f28224932-7ffb
    I
    have read this parts, but it doesnt work the whole way. For example the preview thing i mentioned.
    And no if i only place text i still doesnt work.
    The folder-hierarchy should be the same as the drop-releases?
    The patch-update of the folio producer doesnt work either? (is says the´res a "conflict (in swedish:).
    Many questions, but necessary.
    Best Regards

  • Creating PDF fro InDesign CS4 for screen or print.

    We publish a bi-monthly newsletter that is personalized with our clients' colors and logo. When viewing the PDF at 100% or smaller, the images are pixelated. When magnified, the images are clean and crisp. They also are sharp when printed.
    Is this something that is a result of image quality on the screen or is there something that can be done?
    I am still learning to us InDesign and would appreciate any help.
    Thanks!

    It didn't get attached to your posting, but I did receive your e-mail with the one page attachment and have posted it here. Looking at it with Acrobat, I see no problems at all unless you really blow up the logo beyond about 400% to 500%. It certainly doesn't look bad at all at small magnifications.
    That having been said, if this was my logo, I would use vectors to represent the geometric shapes to the left of the company name. That would avoid jaggies under any magnification. This wouldn't be that hard to do for someone with any reasonable familiarity with Adobe Illustrator.
              - Dov

  • Indesign scripting for footnote

    Hi all,
    We got request from our team to develop footnote handling in XML workflow.
    I need your thoughts to automate the footnote process.
    As you aware that auto footnote cannot handle XML tags. We are planning to have two text streams.
    One for "Text" and other for "Footnote", is that possible to automate this process.
    Searching the Text part for footnote tag and resizing the footnote frame as per footnote citation.
    I need expertise input to complete this task.
    Attached screenshot of page for reference.
    Ranjan

    Hi all,
    We got request from our team to develop footnote handling in XML workflow.
    I need your thoughts to automate the footnote process.
    As you aware that auto footnote cannot handle XML tags. We are planning to have two text streams.
    One for "Text" and other for "Footnote", is that possible to automate this process.
    Searching the Text part for footnote tag and resizing the footnote frame as per footnote citation.
    I need expertise input to complete this task.
    Attached screenshot of page for reference.
    Ranjan

  • Crop mark issue when placing and PDF in Indesign

    I've just had this strange issue that I can't figure out and I'm not sure if anyone else has had it as well.
    I exported a PDF through InDesign with crop marks. I then placed the PDF in Indesign  and for some reason the bleed and the crop marks don't
    show up! I've never had this issue with Indesign before.
    Is it even InDesign, or is it the PDF itself?

    Select show options when placing and select the appropriate crop to choice.
    Bob

  • How do I create an interactive PDF file in InDesign CS6 with Folio Overlays?

    I have been trying to export an interactive PDF file using InDesign CS6. It exports fine, and all the content works except for the Folio Overlays I created. I created two Folio Overlays (one Pan & Zoom and one Scrollable Frame). The overlays work if I preview them from the Folio Overlays panel, but they do not work on the PDF document.
    I am using File >> Export... to create the PDF document, and I am sure the PDF document is of the interactive type and not the print type. Am I exporting it incorrectly? Is there a specific step that I have missed somewhere? Do I need to create a Folio Build to make the Folio Overlays work?
    When I mouse over the Folio Overlays, I get the crosshair cursor which only selects part of the image when I click and drag it.

    PDF is one thing. Folios for DPS is another. There is a little bit of
    overlap but not much.
    The interactivity in the folio overlays panel is for DPS only.

  • Help Needed: InDesign Scripting: PDF Multiple Files and Pages Import

    I am looking for a script to merge two PDFs in InDesign CS3 (Mac or PC);
    with an interesting twist for print production.
    We have one PDF that is 408 pages. The second PDF is only one page.
    What we need to accomplish is importing the 408-page PDF file into InDesign,
    then inserting the second 1-page 408 times PDF AFTER every page of the first
    file.
    This will make a 816-page file, where every other page is the "generic" PDF.
    I've used PDFplacer.jsx and it does a great job of bringing in a PDF to
    InDesign. I'm hoping that there is another script to bring in the second
    1-page PDF and have it place this PDF after every page of the file.
    Does anyone know of a script that will accomplish this task?
    I'd also consider having this same scenario done in Acrobat, and then
    sending this new 816 page file to print, if there is any benefit to creating
    the file this way.
    Any help and suggestions would be greatly appreciated.
    Jim Lukens-Gable
    JHL4 at PSU.EDU

    Thanks, Robin,
    I am really a novice at scripting . . . would you be able to modify the script and then send it to me/post it here?
    Thank you!
    Jim L-G

  • Indesign Contact Sheet script for Adobe Bridge 1.0.4.6

    Our company currently has all the Adobe CS2 products but as stand alone applications and not part of the Creative Suite. Therefore, we don't seem to have all the functionality of the suite.
    In particular the script to create Contact Sheets from Indesign CS2 of items through the script in Adobe Bridge.
    Can anyone tell me if there is a way to add the functionality of the contact sheet script for Indesign to Bridge without having the Adobe Creative Suite? And Why?
    We are looking for something to replace an extension used by Quark to create contact sheets from Badia software. I am loath to upgrade this extension unless absolutely necessary. We receave thousands of photo's a week and output contact sheets for our editors to pick and choose which photos they want/like.
    Thanks in advance.
    Scott

    [email protected] wrote:
    > Larry
    > for us to process thousands of photos this way would take hours.
    Why? Are you talking CPU hours or staff-hours? Does your workflow require heavy
    user interaction or is something else the problem?
    -X
    for photoshop scripting solutions of all sorts
    contact: [email protected]

  • Would like to create a script for list all elements and structure of an indesign document

    Hello everybody,
    I'm a very beginner in indesign scripting.
    I would like to create a script in order to list all elements and the inner structure of a n indesign document.
    The aim for me is to understand how elements are sorted and arranged into indesign, and be able to find an specific element by its item name.
    The output document could be an xml or txt document with a treeview structure.
    I would like have a rough idea of which kind of javascript code I should use for that.
    Thanks for answers.

    Hi Ossydoc,
    You can use Muse to create such a website. All you need to do is, create links in Muse for the sermons and select  " link to File " in the hyperlink option and link to those Mp3 files.
    Please refer to this screenshot :- http://prntscr.com/4xvdup
    Now, when you publish your site,  Muse would automatically upload those files onto the server and the users would then be able to listen as well as download those sermons using the links on your site.
    Hope this helps
    Regards,
    Rohit Nair 

  • Script for InDesign CS6 - create multiple, prenamed layers

    I created a script for Illustrator CS6, in ExtendScript Toolkit, that will create multiple, prenamed layers...see below...
    //Apply to myDoc the active document
    var layerName = LayerOrderType;
    var myDoc = app.activeDocument;
    //define first character and how many layers do you need
    var layerName
    var numberOfLayers=0;
    //Create the layers
    for(var i=0; i<=numberOfLayers; i++)
    { var layerName = ":: GRADIENT";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: STRIPES";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: LEGAL";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: BLK BAR";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: FLAME";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: LOGO/TYPE";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: TRIM,ETC";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = ":: LOEC INFO";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    // Moves the bottom layer to become the topmost layer
    if (documents.length > 0) {
    countOfLayers = activeDocument.layers.length;
    if (countOfLayers > 1) {
    bottomLayer = activeDocument.layers[countOfLayers-1];
    bottomLayer.zOrder(ZOrderMethod.BRINGTOFRONT);
    else {
    alert("The active document only has only 1 layer")
    I tried to use this exact code to replicate the same scenario in InDesign but it doesn't work.
    Can anybody help me out!?
    Thanks in advance

    Marijan Tompa's scripts are very nice and useful, however, for this simple task you can try create your own wiht this code:
    app.activeDocument.layers.add ({name: "GRADIENT", layerColor: UIColors.red});
    app.activeDocument.layers.add ({name: "STRIPES", layerColor: UIColors.lightBlue});
    app.activeDocument.layers.add ({name: "LEGAL", layerColor: UIColors.gray});
    //merge existing document layer to bottom layer (in this case original layer will be merged to 'GRADIENT')
    var myDocument = app.documents.item(0);
    var myLayerA = myDocument.layers.item(2);
              var myLayerB = myDocument.layers.item(3);
              myLayerA.merge(myLayerB);
    alert("Layers created!");
    assume, your document has one layer.
    Script creates three new layers, they appear in Scripts palette in this order:
    LEGAL
    STRIPES
    GRADIENT
    and merges 'old' layer to bottom layer of newly created set (GRADIENT).
    sure, you can add as much layers as you need, just don't forget modify LayerA and LayerB numbers accordingly.
    Or disable second part of the script at all, if you don't want anything to be merged.

  • Is there an updatedcrossrefs script for InDesign CS6

    Running Mac Pro/2.66 GHz—Quad-Core Intel Xeon/Snow Leopard/
    OS/Mac OS X Version 10.6.2/2.66 GHz
    I converted a CS3 InDesign that uses the script "updatedcrossrefs.js", to CS6 InDesign. This file uses hyperlinks on the TOC and Index.
    I tried using the same script for CS3 InDesign in CS6 InDesign but it does not work.
    This is the error message "Could not catch page. Check destination names and existence."
    Is there an updated script for CS6?

    Sorry did not know I was using bold. My co-worker found this script however, she does not work here anymore. But here is the script. I know nothing about scripts except how to use them. Sorry.
    // Updatecrossrefs.js
    // Updates cross references made with hyperlinks
    // the hyperlink destination is where the reference refers to
    // the hyperlink sourcetext is the text that will be updated (like see xx)
    // If a book is open, the book will be handled,
    // if no book is open, the active document will be handled.
    // Made by Teus de Jong, last version April 10, 2006
    // Revisions by Dave Saunders January 22, 2006 and March 20, 2006
    // Thanks Dave!
    // Added unique naming mechanism for sources -- October, 2008
    if (app.books.length == 0){
              if (app.documents.length == 0){
                        errorExit('No documents are open');
              } else {
                        nrofdocs = 1;
                        doc = app.activeDocument;
    } else {
              nrofdocs = app.books[0].bookContents.length;
              for (i = nrofdocs - 1; i > -1; i--) {
                        if (app.books[0].bookContents[i].status != BookContentStatus.documentIsOpen)
                                  app.open(File(app.books[0].bookContents[i].fullName));
              doc = app.open(app.books[0].bookContents[0].fullName);
    for (d = 1; d <= nrofdocs; d++){
              for (i = 0; i < doc.hyperlinks.length; i++){
                        hyper = doc.hyperlinks[i];
                          // leave ID's own internal markers alone
                        if (hyper.name.substring(0, 1) == '.'){continue}
                          // leave hyperlinks to URLs alone
                          try {
                                  if (hyper.destination.constructor.name == 'HyperlinkURLDestination'){continue}
                        } catch (e) {
                                  hyper.showSource();
                                  errorExit('Selected hyperlink has undefined destination');
                        s = hyper.source.name;
                        // added October, 2008
                        // sometimes ID's unique name mechanism for sources fails; make sure the source has
                        // the same name as the hyperlink + '_src'
                        if (s != hyper.name + '_src')
                                  hyper.source.name = hyper.name + '_src';
                        if (hyper.destination.constructor.name == 'HyperlinkTextDestination'){
                                  s = getParentPageName(hyper.destination.destinationText);
                         } else {
                                   // try/catch added to allow for hyperlinks that have lost their destination -- Dave
                                   try {
                                              s = hyper.destination.destinationPage.name;
                                    } catch (e) { continue }
                        if (s != ''){
                                  // Check to see if update needed; saves a lot of time when processing large books -- Dave
                                  if (hyper.source.sourceText.contents != s) {
                                            hyper.source.sourceText.contents = s;
              if (d >= nrofdocs){
                        break;
              doc = app.open(app.books[0].bookContents[d].fullName);
    function getParentPageName(txt){
              try { 
                        var myFrame = getParentTextFrame(txt);
                        var pag = myFrame.parent;
                        while (pag.constructor.name != 'Page'){
                                  // in case the reference is in an inline, the parent of the frame is a character
                                  if (pag.constructor.name == 'Character'){
                                            pag = getParentTextFrame(pag);
                                  // in case the chain goes sour, back out
                                  if (pag.constructor.name == 'Application'){
                                            throw 'Error';
                                  pag = pag.parent;
                        return(pag.name);
              catch (e) {
                        alert('Could not catch page.\nCheck destination names and existence.');
                        return('');
    function getParentTextFrame(x){
              if(app.version == 3){
                        return(x.parentTextFrame);
              else {
                        return(x.parentTextFrames[0]);
    function errorExit(s){
              alert(s);
              exit();

  • How to export book pdf using custom presets for all book files in indesign using javascript

    How to export book pdf using custom presets for all book files in indesign using javascript.

    Hi jackkistens,
    Try the below js code.
    Note: you can change your preset name in below (e.g, Your preset name).
    var myBook = app.activeBook;
    myBook.exportFile(ExportFormat.PDF_TYPE, File (myBook.filePath+"/"+myBook.name.replace(/\.indb/g, ".pdf")), false, "Your preset name", myBook.bookContents, "Book_PDF", false);
    example:
    var myBook = app.activeBook;
    myBook.exportFile(ExportFormat.PDF_TYPE, File (myBook.filePath+"/"+myBook.name.replace(/\.indb/g, ".pdf")), false, "[High Quality Print]", myBook.bookContents, "Book_PDF", false);
    thx,
    csm_phil

Maybe you are looking for

  • How can I copy a backup file from one computer to another?

    I want all of my app date, music, videos, ect to be on a new computer. Is it possible to back up my iPod Touch 3g on my old computer and copy the backup file onto the new computer? If so, how?

  • How to manage a node with cardinality 0..n

    hi, i implemented a application with webdynpro which uses a sap babi. everything wents fine, except that i don't know which container i have to use for a cardinality 0..n. one node has this and so the attributes can entered as often as possible. but

  • No open items

    Hi We have setting up the AP payment run and also the Electronic Bank Statement, but when either are processed the posting to the Bank Account is posted as a Cleared items: The item had been posted and cleared by the key date. I would have expected t

  • Sliders stop working after 20 minutes

    Lightroom sliders in the Develop module stop working all of a sudden after 30 minutes I'm using Lightroom. The other fuctions work but sliders don't. Every time I have to restart Lightroom. Don't know why this happen (I noticed it especially happens

  • Map Excel worksheet into Oracle tables in repository

    I am new to VB2005. I am working on VB code that can map(read) any table from excel worksheet and load it into Oracle tables. Oracle tables that I have are: 1)META_OBJECTTYPES (OBJECTTYPEID pk,OBJECTTYPENAME,OBJECTTYPEDESC, OBJECTMETATYPE,OBJECTDOMAI