ID CC2015 (MacOSX 10.9.5) data merge splitting script - "data are out of reach,"... for the first 99 records?

Hi all.

Scripter Hans Haesler has created a script that I'm sure that a lot of people involved in the merger of data would consider a 'must - have' - the ability to individually named indesign files merging data records (create hyperlinks with script, without a large increase in size and treatment of the BP reqs resulting?). It has improved this script by adding the ability to change the name of the files to the results of a particular field in a database (http://www.hilfdirselbst.ch/foren/INDesign_Script_f%FCr_Datenzusammenf%FChrung_P513807.htm l).

I took his script and does four things to him:

  • CSV splitter now a tab rather than a comma (to use text files delimited by tabs, rather than the files variables separated by a comma);
  • Fixed to be cross-platform CheminDossierCible (wasn't working properly on my mac);
  • fixed a catastrophic bug that could use the assignment information from file names text referenced in the open file dialog box, but the merger of another data base that has been already linked in the file, so added myDoc.dataMergeProperties.selectDataSource(csvFile,) to ensure that myDoc uses the same data file that is called by the File.openDialog;
  • rather than exporting an InDesign file, this operation exports a PDF preset.
var fileNameColumn = 1;//Insert here the column number in the CSV of the new file name is specified. 
var csvSeparator = '\t'//Please here the separator of CSV file Enter 
var destFolderPath = Folder.selectDialog('Destination Folder for PDF files').fsName + '/' ; 
var csvFile = File.openDialog('select CSV file'); 

//CSV import 
var fileNames = new Array(); 
csvFile.open('r'); 
while (!csvFile.eof) { 
   fileNames.push(csvFile.readln().split(csvSeparator)[fileNameColumn-1]); 
   } 
csvFile.close(); 

var myDoc = app.activeDocument;//prepared document  
myDoc.dataMergeProperties.selectDataSource(csvFile,);
myDoc.dataMergeOptions.removeBlankLines = true;
  
var maxRange =  myDoc.dataMergeProperties.dataMergePreferences.recordRange.split('-')[1];//Number of records in the CSV  
//Loop through the records  
for(var  i = 0; i < maxRange; i++)  
   {  
   with(myDoc.dataMergeProperties.dataMergePreferences)  
      {  
      recordSelection = RecordSelection.ONE_RECORD;  
      recordNumber = i+1;
      }  
   myDoc.dataMergeProperties.exportFile((destFolderPath + fileNames [i+1] + '.pdf'), "[High Quality Print]", );
   } 

The best thing - IT WORKS! Well, it does, but something very strange happens. If the database is 99 records or less, the script will be run end until it finishes processing the last record and then this dialog appears:

Screen Shot 2015-07-10 at 11.38.29 pm.png

If the database is 100 records or more, then the script works very well and no warning appears. Despite the files PDF export properly, present a defect is the only thing that keeps me from being happy with the script. It's like having a sports car which turns around when he touches out of ignition, unless its duct more than 100 km and then it not to do so.

For once, I am convinced that the script is written correctly, but I can't work on why this error occurs. Is this a bug in the template script ID, or I missed something? Or is this a bug on my computer only? Is anyone able to attempt to reproduce the fault on their own machine?

Thank you very much

Colin

Never mind colleagues posters, I solved my problem.

From what I can tell, the InDesign is keep in memory the table from the script the first time, it has been run. Not even

fileNames.length = 0;

at the end of the script's force at first.

Way the easiest way is to set a backup statement just before the beginning of the script.

myDoc.save (myFile);

and then, at the end of the script, force the script to close the merge file without saving the changes, but open it back to the top

myDoc.close (SaveOptions.no);

myDoc = app.open (myFile);

I tried

myDoc.revert

but he keeps setting up a dialog box asking "Are you" sure and I don't see anything in

Adobe InDesign CS6 (8,0) object model JS: Table of contents

or

http://www.indesignjs.de/extendscriptAPI/indesign10/

that a property to force a return to actually return without the dialog box.

Regardless, the result is the same – the document close, open and returned to its original state. So far, it seems to work... yay!

Tags: InDesign

Similar Questions

  • Anyone know if there is no CC or BC apps or other alternatives that allow a way to create an online survey consisting of 3 questions for the participants to a trade appear to fill out and submit for the purposes of data collection?  Offlin data collection

    Anyone know if there is no CC or BC apps or other alternatives that allow a way to create an online survey consisting of 3 questions for the participants to a trade appear to fill out and submit for the purposes of data collection?  Offline data collection is a must. Ability to export data to Excel would be an added bonus. Thanks for the tips.

    Hi Nathan,

    This link might help: Create PDF fillable, creative forms of PDF form. Adobe Acrobat DC

    Kind regards

    Sheena

  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

  • Date filter for the first

    I have a report that looks like this:

    WO #, DateEntered, Log #, LogDate
    Adj 1, 01/01/2011, Log31, 02/01/2011
    Adj 1, 01/01/2011, Log62, 03/01/2011
    Adj 1, 01/01/2011, Log78, 04/01/2011
    WO2, 02/01/2011, Log91, 02/01/2011
    WO3, 02/01/2011, Log92, 03/01/2011

    Basically, I need to filter the Date Log or Log # columns on the first entry only. (The journal # colume is in order).
    I only need a line for each WO # and the first journal entry for that WO #.
    What would be the best way to do this?

    Below, you can try to do this:

    In your request for answers, you can create a column of row as below

    rank (LogDate by WO #) and apply the filter on this column "is at the top of page 1".

    Also, specify column WO # in the group clause contained in the Advanced tab of the application.

    I would like to know if it works.

    Thank you

  • Why does my merged project display 2 table of contents for the first project/start?

    I use RH8 and windows 7 and generate Webhelp

    When I generate my merged project I get 2 table of contents of the first project. When I click on other merged projects disappears from the table of contents 2nd and all is well.

    Also, I can't return to my first / start window.

    Here is what I created:

    Main folder

    Parent

    Children

    Project 1 (this is my start/welcome page)

    Project 2

    Project 3

    Project 4

    My Parent file in the table of contents contains new projects and looks like this:

    Project 1

    Project 2

    Project 3

    Project 4

    The only section in the parent file is empty and I put in the following redirection according to the instructions on the site grainge:

    "< meta http-equiv ="refresh"content="0;url=./mergedprojects/project1/project1.htm "/ >

    How stop the TOC 2 on the first page of the project start and how do I display so I can access it later.

    Any help is appreciated.

    Pat

    The start page is not a topic. This is what opens the three components and the topic you see in that is the default theme.

    By default, HR takes the name of your project and which initially applies the page so if your project is called redrabbit, the start page will be redrabbit.htm.

    Many authors can call the redrabbit of the theme by default as it is the name of the project and it seems logical.

    Problem is when the wizard attempts to use it as the default value for the start page, the name is used for the number 1 is added.

    This means that you end up with redrabbit and redrabbit1. If you look in the wizard, you will see the name of the start page, first on the ground. You do not redirect, that redirect you to the default topic that is longer than down in the page of the wizard. The index is that the field is called the default theme.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • Fusion of data - several images to compensate for the resulting page and registers

    I designed a form of writing simple exhibition of 3 fields, a logo (png), and a title area. This unique, simple, layer grouped when merged with data using several cliché product registration 54 pages of 8 cards per page: exactly as expected. However, the group resulting from cards on each page is offset. If 8 are grouped together and then the Group centered vertically and horizontally on each page this product the last printable pages.

    I read that number of entries forum as appear relevant, have tried the Master object, played with spacing and margins but always result with 8 cards from shift of centering. I have also searched/view Lynda.com, YouTube and other references. I obviously do not see where this offset numbers tie in with other parameters of the page. All the parameters of the page are borderless, bleeding etc.

    Where I wrong or what is the problem? I guess I could (with learn how do) create a macro to the group the cards on each page and then Center of each, but surely, this is not the result you expect from InDesign.

    Machine: Windows 7, running CS6 8.0.1

    Thanks for any help or pointers anyone can offer.

    Preview can be buggy, and I think it can "infect" your model, so I'm going to suggest you make a new template file, and then copy and paste your placeholders in it. Put them in the upper left corner.

    If possible, make the group placeholder smaller than necessary to fill the page when duplicated 8 times without space between and set the top and left margins to position it correctly. In the merge options add necessary spacing, leaving the upper part and fix the left margins, but set the down and right on 0 (data fusion can be weird about editing when the margins are quite right, too).

    Finally take a leap of faith and merger without preview.

  • Can I flag on iPad for deleting and data synchronization to my office for the suppression of the CATALOG. Is this possible?

    I want to mark photos on my iPad for deletion and have this synchronization of data to my office for the suppression of the CATALOG. Is this possible?

    Yes, this is how it works.

  • Date query shows no results for the date of the day

    Hello everyone. I use Jdeveloper 11.1.1.3.0 with ADF and I have a view named query with a single field, Date. The operator that he uses is equal to a value written in the field. The problem is that when I insert a line in the table (the date is automatically set to the current date on the insertion) and I'm looking for today it returns nothing. However if I leave the field blank it will find me the line. I tried to do this with the timestamp option, but it is not very user-friendly, the user will need to type in the time line was inserted to find, or use between it operator for two fields which is something I want to avoid if possible

    The requirement is a query field that allows the user to choose a date on the calendar and shows all lines that are inserted at this date (even if the date is today, and the line was inserted a few minutes before).

    Published by: Dino2dy on April 6, 2011 02:50

    Dino2dy,

    The best way to proceed would be just to add an additional attribute to your VO - use "TRUNC (your_date_column_name)" as the value for the attribute - then just compare this attribute in the named view criteria.

    John

  • How to recover data from form (UD_ADUSERS) AD for the configured users?

    I need to get objectGUID and sAMAccountName for users who are already provioned to AD.
    I want to get this info using the API of IOM - what is stored in the UD_ADUSERS table in the backend.

    Is it possible to get this data using IOM API?

    I have a contarainst because I get other fields using IOM API using tcUserOperationsIntf. But this interface provides no access to form data.

    Concerning
    Vijay Colin

    I suggest that you write an adapter that does the following:

    Possess a key user, resource object and field name UD entry. In your code, do the following:

    Find items for the user.
    Scroll through the list and match the resource name and correct the State of commissioning. That you will get the key of the process Instance.
    Get the shape data of process for the given process instance key.
    To loop through the result set for the given domain name.

    You can then create an adapter with this code and everywhere where you want to use it again.

    -Kevin

  • Federated back cached data are saved to disk on the local cluster?

    With the new feature Federated consistent caching, 12.2.x, is the internal cache containing rear replication data saved to the local drive?

    What happens if the local cluster goes down, when there is great in waiting for data of backlog waiting to be replicated (probably due to remote cluster being down for an extended period)

    Can this back then recovered and reread cluster remote automatically when we have cold restart the local cluster?

    Any pointers to documentation of coherence on the above issues would be useful.

    To persist a Federated Cache, including arrears, all you need to do is configure on your diagram of federated, as you would for a distributed system.

    Why?  Federated Caches are in fact increased distributed Caches, which basically means that all of the features available for distributed Caches are also available to Federated Caches!

    Basically just add the following to your Federated plan

    active by default

    For more information on the new features of persistence, take a look at:

    http://docs.Oracle.com/middleware/1221/coherence/administer/persistence.htm#COHAG5327

    I hope this helps.

    -Brian

  • connect 6 1 year old iphone to itunes for the first time without data loss

    They (pc and iphone) are both devices allowed on the itunes account.

    Can you give us more information please? What kind of messages do you see? -AJ

  • Setup error: Setup for thie product data are damaged. Please contact the support staff.

    I tried to install a game called Guitar Hero World Tour for the second time on my computer. The first time I didn't delete it properly: I deleted everything first in the folder that leave the Add / Remove programs and now when I run the installation of the game it gives me this error. Can you please tell me what I need to do?

    Thank you
    George Cazan.

    You can try and use it to clean up the leftovers and then reinstall.

    http://www.revouninstaller.com/

    I hope this helps.

  • Data are not engaging in the table

    Hi all

    I have a requirement in which I need to add the following in an existing page.

    There is a query with a simple search panel and tabel corresponding region on the page. My requirement is to add a new field in the search panel and
    in the table. I did it successfully. The table has an update icon in which you navigate to a page where you can go and update all fields. But what is happening is that all the data are correctly updated except for the newly added field. Value NULL is is filled in the table.

    In the existing page they use an entity object to insert/update in tabel.

    I followed the following steps:

    1 has created a new field in the research and the table Panel.
    2 aajoutee new attribute in EO and VO.
    3. has created a new field in the page updated and joint vo attribute to it.


    But the data are fill in the tabel except adding the newlt field.


    Please help me.

    Adam

    There is no option to synchronize if Jdev 10 G. He is smart enough to take care of this. But if you add a new attribute to your existing VO EO-based, you can deal with a bug that is mentioned in the link below.

    You need to modify the generated XML. So, please check this link.

    http://oracleanil.blogspot.com/2010/11/EO-based-vo-extension-in-OAF-R12.html

    I hope that helps!

    Thank you
    AJ

  • Quick way to copy all the data to Ipad Air 2 for Ipad Pro

    I would like to copy all the data on my Ipad 2 for the new Ipad Pro Air I just bought to avoid Delisle in downloading applications.

    Hello

    You'll be happy to learn that it is a very easy process!

    This should help:

    Transfer the contents of an iPhone, iPad or iPod touch to a new device - Apple Support

    Let me know how you go!

    All the best.

  • iTunes store: no order by Release Date for the album option

    One of the reasons only I never loaded to the top of the iTunes store, was to see what album had been released recently. I've just loaded to the top of the iTunes Store for the first time since before Christmas, and the order of the option of Release Date went. Nobody knows when and maybe why this option has been removed?

    Now, I have to dig through what album other people bought, or what Apple think I should buy it, but I don't worry about this. By removing this option, he'll probably refuse the new exhibition albums if they did not return to the idea of Apple which is worthy of my attention, or that what other people buy in... I want just an objective list of what's new.

    I had thought to install an older version of iTunes to see if it would give me the back of the option, but I don't see anywhere to get older versions of the installer, or actually know if it still works. I'm at the mercy of apples * manufactured * popularity ratings, or someone knows a way to the option to come back?

    End of December and beginning of January are slow week for new releases.  However, you are not "forced" to do something. Take the opportunity to go on a few other stores such as Amazon digital music music download.

Maybe you are looking for

  • AT200 - Support for Ethernet USB

    Hello We plan to install several AT200 as kiosk services in our Museum. We just test a USB OTG cable, and it works very well with keyboards and USB storage using the latest version of the ICS. However, when you connect an adapter ethernet-usb (asix c

  • Tecra M2: change the display to SXGA +.

    HelloI want to change the display in my notebook tecra m2, homosexuals in service for example, I ned a difrent display cable.Have you seen any dfrent display cable? What are you thiking on this subject?Help, please.

  • Satellite A100 PSAA9A - can read DVD BUT not CD with Windows XP

    I use a satellite A100 PSAA9A computer laptop and I started having trouble with the CD/DVD drive. It was working fine until yesterday when he decided not read no matter what CD I get the message asking me to insert a disc, when there is a CD in the d

  • SCXI-1581 reading bad weather

    Hello I'm an intern summer and I'll try to find some help with the SCXI-1581 module. We had a major failure during the test of an engine and it damaged some of the test equipment. We have replaced all that appears to be damaged and tried to restart t

  • Why the bar tasks there into two lines

    Suddenly, my taskbar are appeared in two rows. The bottom row includes icons for my Docujments, my computer and Recycler Bin.Why does this happen and how do I get this back to a line?