Script for Exporting 2 Pgs into 1 PDF???

Hello, I was wondering if anyone can help me. I know there is a script that can export each page of Indesign file as a separate PDF, but is there a script out there to export every two pages of Indesign file.
Basically what I need to do is create 300 customized documents (based on personal company information) and Export them to a PDF so that I may e-mail one to each company. The document must be two pages, the first page has the personalized (merged) information, but the second page will be exactly the same on all of them.
Can you tell me how I can do this in Indesign, or if not Indesign, Acrobat? I ran a test with the Data Merge system in Indesign. (I created a .CSV file with 2 columns; Company Name and Company Product and took 5 five companies from the master list to test.)
After the merge, all the fields populated correctly but I wound up with a 10 page .INDD document. (the odd number pages are the ones with all the "merged" personal info, while all the even number pages exactly the same) What I need now is every 2 pages to be exported as 1 PDF file.
Is there is an easier way to do this? And if not in Indesign, is there an easy way to extract 2 pages at a time in Acrobat?
Thank you very much for any help, much appreciated,
Kevin

Hi Kevin,<br />Here is another version.<br />copy/paste into a text editor then save as a .jsx and place it in the script folder.<br />The only thing you have to modify is the name of your pdf preset. I thought about a dialog where tou could have switched frome one preset to another easily. But it may much more efficient to just modify the name of the preset. If you want you an also make a copy with another PDF preset then rename it.<br /><br />ad = app.activeDocument;<br />pg=ad.pages;<br />var docpath = ad.filePath;<br />var docname = ad.name;<br />var nb = (Math.round(Number(pg.length/2)))<br />for(i=0; i<nb;i++)<br /><br />{<br />]var pgrgstart = (pg[(2*i)].name);<br /><br />]if(pg[(2*i+1)]==-1)<br /><br />]{<br /><br />]]var pgrgend = pgrgstart;<br /><br />]}<br /><br />]else<br /><br />]{<br /><br />]]var pgrgend = pg[(2*i+1)].name;<br /><br />]}<br /><br />]app.pdfExportPreferences.pageRange = pgrgstart+"-"+pgrgend; <br /><br />]var myPDFExportPreset = app.pdfExportPresets.item("your PDF preset"); <br /><br />b //enter the name of your PDF preset instead of your PDF preset<br /><br />]ad.exportFile(ExportFormat.pdfType, File(docpath+"/"+docname.split(".indd")[0]+"_"+"pg_"+i+"_to_"+(i+1)+".pdf"), false, myPDFExportPreset); <br /><br />}<br /><br />alert("done");

Similar Messages

  • Needed: Script for exporting iPhoto albums into a file structure

    Hello all! I have no experience with AppleScript, but I heard it should be possible to write a script which helps to copy/export a iPhoto album structure into an according directory structure. Does anybody already have such a script?
    Thx for any information on that!

    Thomas,
    I have created an AppleScript along with the TextCommands OSAX that duplicates all of the albums in iPhoto to a folder called "Albums" on the desktop. It is quite slow because of the need to open an Info window in Finder to get the path to the original photo but gets the job done.
    If you wish it could be modified to provide an ability to select individual albums for duplication. Let me know if you are interested in the latter. I am also seeing whether the album structure can be created directly in a burn folder so that CDs/DVDs can be rapidly burned.
    TextCommands is donationware and available at the following location:
    http://osaxen.com/files/textcommands1.0.1.html
    and should be placed in the following location for the AppleScript to see it:
    ~/Library/ScriptingAdditions/
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">property PathToDesktop : path to desktop as string
    property PathToPictures : path to pictures folder as string
    property PathToiPhotoLibrary : PathToPictures & "iPhoto Library"
    property PathToiPhotoAlbums : PathToiPhotoLibrary & ":Albums"
    property PathToCopiedAlbums : PathToDesktop & "Albums"
    tell application "Finder"
    activate
    set theCopiedAlbumsFolder to duplicate folder (PathToiPhotoAlbums as alias) to desktop
    set theAlbums to folders of folder PathToCopiedAlbums
    set theExtraneousFiles to files of folder PathToCopiedAlbums
    delete theExtraneousFiles
    repeat with anAlbum in theAlbums
    repeat with anAlias in anAlbum
    -- need to use GUI access to grab the path to the original photo
    open information window of anAlias
    tell application "System Events"
    tell process "Finder"
    -- grab the path to the original file
    set PathToTheOriginalPhoto to value of static text 2 of scroll area 1 of window 1
    end tell
    end tell
    close window 1
    -- need to remove some extraneous material and convert to AppleScript path format
    tell application "TextCommands"
    split PathToTheOriginalPhoto using {":", "../"}
    set PathToTheOriginalPhoto to item 4 of the result
    set PathToTheOriginalPhoto to search PathToTheOriginalPhoto for "/" replacing with ":"
    set PathToTheOriginalPhoto to (PathToiPhotoLibrary & ":" & PathToTheOriginalPhoto) as alias
    end tell
    (* unfortunately there seems to be bug in duplicate file to another folder so must use a copy, , delete the alias, move, and clean up name of copied file sequence to accomplish the equivalent *)
    -- duplicate the original in the original album folder
    set theCopiedPhoto to duplicate PathToTheOriginalPhoto
    -- Delete the alias in the Copied Album
    delete anAlias
    -- Move the copied photo to the Copied Album
    set theCopiedPhoto to move theCopiedPhoto to anAlbum
    -- Remove the "copy" from the photo names
    set NameOfPhoto to name of theCopiedPhoto
    tell application "TextCommands"
    set name of theCopiedPhoto to search NameOfPhoto for " copy" replacing with ""
    end tell
    end repeat
    end repeat
    end tell</pre>
    PowerBook 12" Mac OS X (10.4.6)

  • Export from indesign into a pdf (destinations)

    Hallo,
    when I export a indesign file with destinations into a pdf and view in the pdf the destinations, I found that there is now a number added behind the destination. For this reason Links into the pdf does not work any longer.
    eg: "dsrg.indd:article_10" changes to "dsrg.indd:article_10:637". How can I avoid the number at the end.
    Thank you for your help.
    Roland

    Hi isarviking,
    Would you send your PDF document to [email protected] as an email attachment?
    I will check it from my end.Please add the link to this forum post for reference.
    Regards,
    Florence

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Script for export in datapump  -- help needed !!!

    hello all,
    i am using the following script as batch file in my database for export
    script:
    =========
    exp name/password file=d:\exp\%date%.dmp full=y log=d:\exp\exp.log an this will replace the first file(monday) on next monday.
    similar way i need a script for data pump for full database export using datapump
    thanks ,
    gold

    login to database as a dba and create directory for your dumpfile path.
    create directory dpump_dir as 'd:\exp';
    and then use the below script for export.
    expdp username/password full=y directory=dpump_dir dumpfile=%date%.dmp logfile=exp.log

  • How to make a Word for Mac 2008 doc into a PDF using Acrobat Macintosh

    Any ideas how to turn a Word for Mac 2008 document into a PDF using Acrobat Pro?
    Thank you if you can help.

    In Word  2008 for Mac:
    go to Save As... from File menu.
    when window open click on Button show the current file type.
    when thi menu drops down you will see the following
    Choose PDF
    save.
    Then open up in Acrobat.

  • Scripts for Exporting Master/Work Rep

    Hi,
    I want to automate the export process and in turn was looking for any scripts for exporting the whole ODI Work/Master Rep. I checked the CLASS objects and we donot have any CLASS names for Repository exports.
    Thanks in advance for any answers..!

    Created for 10g [ http://odiexperts.com/automize-the-backup-using-odi-exports]
    but should work for 11g too :)

  • Script for export from eps to jpg done. Just need to know jpg pixel dimensions?

    i have a script which export eps to jpg using below script (width is always 1276 px). Is there any way to know the dimension of the each jpg files as an alert?
    #target illustrator
    var i,  files, sourceDoc, targetFile;
    files = File.openDialog ("Hi, Please select EPS file(s)", /.eps$/, true);
    try
    if (files.length > 0)
      for ( i = 0; i < files.length; i++ )
            sourceDoc = app.open(files[i]);
            var myVisibleBounds = sourceDoc.visibleBounds;
            myVisibleBounds[0] = myVisibleBounds[0] - 1;  // left
            myVisibleBounds[1] = myVisibleBounds[1] + 0.5;   // top
            myVisibleBounds[2] = myVisibleBounds[2] + 1;   // right
            myVisibleBounds[3] = myVisibleBounds[3] - 1 ;    // bottom
            sourceDoc.artboards[0].artboardRect = myVisibleBounds;
    //        var docLeft = sourceDoc.artboards[0].artboardRect[0] - 50;
    //        var docTop = sourceDoc.artboards[0].artboardRect[1] + 50;
    //        var docRight = sourceDoc.artboards[0].artboardRect[2] + 50 ;
    //        var docBottom = sourceDoc.artboards[0].artboardRect[3] -50 ;
            var sourceDocWidth = Math.round(myVisibleBounds[2] - myVisibleBounds[0]);
    //        var sourceDocHeight = docTop - docBottom;
            var myZoom = (1276/sourceDocWidth) * 100;
    //        alert(sourceDocWidth + " Math round: " + Math.round(sourceDocWidth) + "   " + myZoom);
            targetFile = getNewName();
       // Call function getPDFOptions get the PDFSaveOptions for the files
            exportOptions = exportJPEG( );
       // Save as pdf
       sourceDoc.exportFile (targetFile, ExportType.JPEG, exportOptions);
       sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
      alert( "Done" );
    catch(e)
        alert(e +  "\r" + "No files selected");
    function getNewName()
    var ext, docName, newName, saveInFile, docName;
    docName = sourceDoc.name;
    //ext = '.pdf'; // new extension for pdf file
    newName = "";
    for ( var i = 0 ; docName[i] != "." ; i++ )
            newName = newName + docName[i];
    newName = newName;
    saveInFile = new File(sourceDoc.path + '/' + newName );
        return saveInFile;
    function exportJPEG()
        var exportOptions = new ExportOptionsJPEG();
        exportOptions.artBoardClipping = true;
        exportOptions.antiAliasing = false;
        exportOptions.qualitySetting = 100;
        exportOptions.horizontalScale = myZoom;
        exportOptions.verticalScale   = myZoom;
    //    exportOptions.transparency = false;
    //exportOptions.saveAsHTML = true;
        return exportOptions;

    Does this help?
    I do applescript and javascript is another language but I found this by searching google:
    var img = document.getElementById('imageId');
    var width = img.clientWidth;
    var height = img.clientHeight;
    From:
    Determining image file size + dimensions via Javascript? - Stack Overflow

  • Exporting from InDesign into a PDF to be used in Acrobat question.

    Hi, I'm trying to figure out if there's a way when exporting to PDF to leave fields open/editable(not the word im looking for) so that when the form is opened in Acrobat the form can be typed on/on top of, dont want to change/edit the actual document.
    What i have is an InDesign doc, that just a form for college classes (things like Course #, Course Title, Credit hours, Final Grade, College, ect) So there are blank spaces in the Table we made that need to be filled in at a later date, those In past times the completed form would have just been printed out and the person filling it out would just write that in. What i'm wanting to know is if there is way that i can set up the document for export to the PDF, that the program recognizes that those spaces need to be left so that we can type in it in another program, like Acrobat. Its for college office work so our office ladies dont have indesign and use acrobat regularly.
    I hope that makes sense i can try to explain again if need be. A pic of the table is attached.
    Thanks

    Yeah that's the best bet, though if you don't want to make a bunch of fields, you can also just save it with the Typewriter tool enabled in Acrobat (Tools > Typewriter > Enable Typewriter Tool in Adobe Reader).  Then, the person viewing it will get a little typewriter tool that they can use.  I think they have to have version 9 of Adobe Reader.
    But it looks the best to add in all the fields individually.
    Hope that helps,
    Phyllis

  • Script for export all text in single rtf file?

    Hi!
    I need to export all storys from indd document to a single rtf file. Is there avaible some free script for CS4 which can do that?

    if(app.documents.length != 0){
         if(app.documents.item(0).stories.length != 0){
              myGetFileName(app.documents.item(0).name);
    //========================= FUNCTIONS ===========================
    function myGetFileName(myDocumentName){
         var myFilePath = File.saveDialog("Save Exported File As:");
         if(myFilePath != null){
              myDisplayDialog(myDocumentName, myFilePath);
    function myDisplayDialog(myDocumentName, myFilePath){
         //Need to get export format, story separator.
         var myExportFormats = ["Text Only", "Tagged Text", "RTF"];
         var myDialog = app.dialogs.add({name:"ExportAllStories"});
         with(myDialog.dialogColumns.add()){
              with(dialogRows.add()){
                   with(dialogColumns.add()){
                        var myExportFormatDropdown = dropdowns.add({stringList:myExportFormats, selectedIndex:0});
              with(dialogRows.add()){
                   var myAddSeparatorCheckbox = checkboxControls.add({staticLabel:"Add separator line", checkedState:true});
         var myResult = myDialog.show();
         if(myResult == true){
              var myExportFormat = myExportFormats[myExportFormatDropdown.selectedIndex];
              var myAddSeparator = myAddSeparatorCheckbox.checkedState;
              myDialog.destroy();
              myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator);
         else{
              myDialog.destroy();
    function myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator){
         var myPage, myStory;
         var myExportedStories = [];
         var myTempFolder = Folder.temp;
         var myTempFile = File(myTempFolder + "/tempTextFile.txt");
         var myNewDocument = app.documents.add();
         var myDocument = app.documents.item(myDocumentName);
         var myTextFrame = myNewDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myNewDocument, myNewDocument.pages.item(0))});
         var myNewStory = myTextFrame.parentStory;
         for (var i = 0; i < myDocument.pages.length; i++) {
              myPage = myDocument.pages.item(i);
              for (var t = 0; t < myPage.textFrames.length; t++){
                   myStory = myPage.textFrames[t].parentStory;
                   if (!IsInArray(myStory.id, myExportedStories)) {
                        //Export the story as tagged text.
                        myStory.exportFile(ExportFormat.taggedText, myTempFile);
                        myExportedStories.push(myStory.id);
                        //Import (place) the file at the end of the temporary story.
                        myNewStory.insertionPoints.item(-1).place(myTempFile);
                        //If the imported text did not end with a return, enter a return
                        //to keep the stories from running together.
                        if(i != myDocument.stories.length -1){
                             if(myNewStory.characters.item(-1).contents != "\r"){
                                  myNewStory.insertionPoints.item(-1).contents = "\r";
                             if(myAddSeparator == true){
                                  myNewStory.insertionPoints.item(-1).contents = "----------------------------------------\r";
                   } // if not exported
              } // for text frames
         } // for pages
         switch(myExportFormat){
              case "Text Only":
                   myFormat = ExportFormat.textType;
                   myExtension = ".txt"
                   break;
              case "RTF":
                   myFormat = ExportFormat.RTF;
                   myExtension = ".rtf"
                   break;
              case "Tagged Text":
                   myFormat = ExportFormat.taggedText;
                   myExtension = ".txt"
                   break;
         myNewStory.exportFile(myFormat, File(myFilePath));
         myNewDocument.close(SaveOptions.no);
         myTempFile.remove();
    function myGetBounds(myDocument, myPage){
         var myPageWidth = myDocument.documentPreferences.pageWidth;
         var myPageHeight = myDocument.documentPreferences.pageHeight
         if(myPage.side == PageSideOptions.leftHand){
              var myX2 = myPage.marginPreferences.left;
              var myX1 = myPage.marginPreferences.right;
         else{
              var myX1 = myPage.marginPreferences.left;
              var myX2 = myPage.marginPreferences.right;
         var myY1 = myPage.marginPreferences.top;
         var myX2 = myPageWidth - myX2;
         var myY2 = myPageHeight - myPage.marginPreferences.bottom;
         return [myY1, myX1, myY2, myX2];
    function IsInArray(myString, myArray) {
         for (x in myArray) {
              if (myString == myArray[x]) {
                   return true;
         return false;
    This is a revised version of the script --  not totally tested.
    Kasyan

  • Error for linking ecatt Script for exporting parameter

    Hi,
    We have 2 SAPGUI scripts, one is transaction CO01 to create the production order. The other is CO02 to release the production order. In the first script I get production order number as parameter 1 in the message field. I need to export this field to second script for releasing order.
    I am not able to pick the order.
    Tried to use ABAP code
    ABAP.
    DATA: z_aufnr like CAUFVD-AUFNR.
    get parameter id 'ANR' FIELD Z_AUFNR.
    ENDABAP.
    Still export parameter in log comes as empty. So if I create thrid script using ref# it errors out at second script start.
    Your help is greatly appreciated.
    Thanks,
    Gajanan

    Hi
    you don't have to use abap for this .
    in the command editor
    choose first script recording interface and double click it ,observe the screen list on right side and now select the last screend and double click field and parameterize it say give it a  name as variable1 by entering this in valin column.
    Create a parameter and by param1 name and export type and default values as variable1.
    Now for the second script create a parameter as import type and set it's value as &param1&.
    Also pass this value to second script by the same as you done for first script.
    This will work for sure.
    To know more how to parameterize follow the links,
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation-150-tcd-mode-part-ii
    http://www.sapecc.com/tutorials/secat_create.htm
    Please reward points.

  • Script for exporting the Delegated List from Exchange 2007

    We are Planing to Migrate the Exchange 2007 Mailbox to O365 by Hybrid deployment.
    So i would like to generate the List of delegated access rights on Mailboxes, could you help the script for genetating the delegated list.

    Hello,
    Look into get-Help Get-MailboxPermission
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Need script for exporting images to EPS

    I need to write a script to export a whole bunch of files from Indesign CS3 to EPS files. Right now we do them one at a time...here are the steps we take that we would need included in the script...
    Select all (Control A), ungroup, convert to outlines (control-shift O), export (need to be able to say black or white or RGB) and then close the file without saving.
    and if there was anyway to loop this script for 20 files at a time that would be really helpful.
    Can any help or direct me to a website that can help.
    Thanks!
    Marissa

    Maybe this one: http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    Peter

  • Script for exporting all stories to one RTF file

    Hi, I've been searching for this as I know it's been asked before, but I haven't had any luck finding it yet: Wasn't there a script that someone developed which would allow you to export all stories from an InDesign document into a single RTF file? Or is that wishful thinking....
    Thanks, Phyllis

    http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    Kasyan

  • FDM - Scripting for exporting application

    Hi
    Can you please advise if it is possible to write a script to automate the FDM export (Application export, this would be for the locations, users, maps etc...)
    Regards
    Edited by: user12990175 on 2010/07/05 11:59 PM

    I have not seen any scripts be used to automate this process. Keep in mind that an application extract can only be loaded into a fresh FDM application, it cannot be used to merge metadata between two FDM applications. I don't really see much of a purpose to automate this process, it is something that normally should be done manually.

Maybe you are looking for

  • Disk images not mounting

    Here's the question: how come .dmg files downloaded from apple.com (amongst other places) won't mount? Here's the detail: This has to be a FAQ going by Google searches. I've downloaded the Mac Firefox DMG 3 times, and the Safari DMG from apple.com on

  • My iPhoto won't open it says that the library is locked

    I cannot access the photo library and all my iphone pictures are stored there and lots of pictures from my work that i dont have anywhere else

  • Granting an admin rights to view and execute a task with user actions

    I am trying to grant an admin the rights to view and execute a new task that i have created from the search results and user actions applet. I have added an auth type to the authorization types configuration object with the following: <AuthType name=

  • WM: opportunistic cross-docking

    Hi all, According to my understanding of the help.sap.com online documentation, we are NOT supposed to use the Cross-docking Monitor while trying to achieve an opportunistic cross-docking stock transfer between an inbound delivery and an outbound del

  • Invalid serial number for Elements 9 worked fine before

    I Had to change a bad hard drive. Before that my Photoshop Elements 9 worked fine. Now I get a message the number is invalid. I paid for it with a new Dell computer and Adobe won't help. These keep passing me to Dell even though it is their serial nu