Data merge colour change

Is there a way to change the text in a single data merge field to two separate colours?
ie a script of some sort?
thanks in advance

You could run a GREP find/change after the merge to get rid of any extras. This will find any duplicate comma-space sets and replace them with one comma followed by one space.

Similar Messages

  • QR Data Merge - colour change

    I'm using the new QR data merge function but I need the QR codes to be blue not black.
    I have contacted Adobe and their useless suggestion was to use the "edit QR code" menu option.
    This isn't ideal for several thousand posters. It seems like a pretty obvious requirement, I hope they fix this oversight soon.
    Does everyone have ideas about how I can change the colour change to the QR codes in bulk?

    Create 1 QR code and recolour it.
    Save it as an object style.
    Then apply it to the data merge area for the QR code.
    Hope that works - I've never tried it, just an idea off the top of my head.

  • Search for a string in Data Merge, then change the font color

    I'm working on a postcard-style invitation with the addresses on the back. So far, I've finished the invitation and the mail-side template with a Data Merge to a CSV file successfully. Now, as part of my design, I want all of the letter "b"s on the mail-side template (Data Merge) to be yellow. Using JavaScript is this possilbe? This is what I have so far, but something is wrong:
         app.findTextPrefences = NothingEnum.NOTHING as FindTextPreference;
         app.changeTextPrefences = NothingEnum.NOTHING as ChangeTextPreference;
         var myColor:Color = myDocument.colors.add();
         myColor.model = ColorModel.PROCESS;
         myColor.space = ColorSpace.CMYK;
         myColor.colorValue = [0, 0, 100, 16];
         app.findChangeTextOptions.caseSensitive = false;
         app.findChangeTextOptions.includeFootnotes = false;
         app.findChangeTextOptions.includeHiddenLayers = false;
         app.findChangeTextOptions.includeLockedLayersForFind = false;
         app.findChangeTextOptions.includeLockedStoriesForFind = false;
         app.findChangeTextOptions.includeMasterPages = false;
         app.findChangeTextOptions.wholeWord = false;
         app.findTextPrefences.findWhat = "b";
         app.changeTextPrefences.fillColor = myColor;
         app.findTextPrefences = NothingEnum.NOTHING as FindTextPreference;
         app.changeTextPrefences = NothingEnum.NOTHING as ChangeTextPreference;

    Hi,
    After setting preferences you need to call changeText() method, like
    myDoc.changeText();
    or
    myStory.changeText();
    But this is a static solution.
    You could use a dinamic solution by define a proper characterStyle and take advantage of nestedGrepStyle in style applied to this part of your design.
    So each character "b" could be applied with your characterStyle automatically, no need to run a script.
    Jarek

  • Scripting a file name change as a data merge element.

    My goal of the work being done with InDesign is to utilize the Data Merge functionality of InDesign and the, already available, ability to create a new document per record in your data source where the docuement name is changed based on data contained in the data source.
    A very simple example of this would be the following:
    EXAMPLE
    ======================
    Given the following data source in excel:
    First_Name
    Last_Name
    ResultingFileName
    George
    Smith
    c:\A45.pdf
    Mary
    Lopez
    c:\C99.pdf
    Steve
    Barns
    c:\tmp\XM96TR.pdf
    Along with a simple two text box InDesign documents, I would perform a standard data merge with First_Name linked to one text box and Last_Name linked to another.  By setting the “Record Limits Per Document” to 1, I would end up with three different documents.  By default, the documents would be named Untiltled-1, Untiltled-2 and Untitled-3. 
    Untitled-1 would contain George and Smith.  Untitled-2 would contain Mary and Lopez and Untitled-3 would contain Steve and Barns.
    At this point in time, I would run the new created script, which would do the following:
                Rename Untitled-1 to A45 and/or save Untitled-1 as C:\A45.pdf
                Rename Untitled-2 to C99 and/or save Untitled-2 as C:\C99.pdf
                Rename Untitled-3 to XM96TR and/or save Untitled-3 as c:\tmp\XM96TR.pdf
    I am open to modifying the manner in which the data merge source is created.  For example, separating the path and the file name into separate columns.  In addition, I am flexible in putting preset information and/or file save types into the data merge document.
    Please feel free to contact me directly at [email protected]
    Thanks in advance for the help.
    Matt

    Hi Matt,
    I think it’s better to use an XML-based approach for your task.
    I’ve never scripted Data Merge process, but I don’t see a straightforward way of doing it. May be you can create the 3rd textbox on pasteboard or a non-printing layer, which will contain the file path from ‘ResultingFileName’ field, and the contents from which can be used for naming & saving the current file and exporting it to pdf-file. But this approach is so clumsy.
    Instead, you’d better to keep your data in excel file, or even better Access or some other database program.
    Export the data from it in XML-format.
    Then import it to an InDesign file and process it by script. XML support is very powerful in InDesign: you can process your data by xml-rules. I once made a script for a newspaper, which processed data for classified ads. The script applied all formatting, changed colors for different headings and placed images.
    Kasyan

  • Data Merge - Change Text/Cell Characteristics based on Data Value

    I am working on a letter that is sent to our diabetic patients during their birthday month...the letter will contain the last known test results and date for several measures and then recommend action based on those results.
    The data comes from a text file (csv file separated by "^") generated by our Electronic Medical Record (EMR) database...
    What I need is a script or tool that will recognize specific text and then change the font size and cell background for that particular field...
    In the first example below, everything is normal, so there is no notification necessary...
    In the second example, the BP is too high (calculation is performed by our EMR), so the csv file includes "Due Now" and "Yes" for the final two columns in the table.  The script needs to recognize "Due Now," enlarge the font, change the color, and change the background color of the cell, and then recognize "Yes" and do the same.
    Is this possible?  Is there a tool/script/method that I need?
    Example 1
    CSV File Text:     ^130/70 (3-28-2011)^Next Visit^No^
    InDesign Table:
    Measure
    Your Goal
    Your Results
    Next Test?
    Contact Doctor?
    Blood Pressure
    < 130/80
    130/70 (3-28-2011)
    Next Visit
    No
    Example 2
    CSV File Text:     ^160/90 (3-28-2011)^Due Now^Yes^
    InDesign Table:
    Measure
    Your Goal
    Your Results
    Next Test?
    Contact Doctor?
    Blood Pressure
    < 130/80
    160/90 (3-28-2011)
    Due Now
    Yes
    Thanks!
    B. Mark Hooten
    Medical Media, Mail Room, Print Shop
    O k l a h o m a  C i t y  V A M C

    Mark.Hooten wrote:
    I am working on a letter that is sent to our diabetic patients during their birthday month...the letter will contain the last known test results and date for several measures and then recommend action based on those results.
    The data comes from a text file (csv file separated by "^") generated by our Electronic Medical Record (EMR) database...
    What I need is a script or tool that will recognize specific text and then change the font size and cell background for that particular field...
    In the first example below, everything is normal, so there is no notification necessary...
    In the second example, the BP is too high (calculation is performed by our EMR), so the csv file includes "Due Now" and "Yes" for the final two columns in the table.  The script needs to recognize "Due Now," enlarge the font, change the color, and change the background color of the cell, and then recognize "Yes" and do the same.
    Is this possible?  Is there a tool/script/method that I need?
    Example 1
    CSV File Text:     ^130/70 (3-28-2011)^Next Visit^No^
    InDesign Table:
    Measure
    Your Goal
    Your Results
    Next Test?
    Contact Doctor?
    Blood Pressure
    < 130/80
    130/70 (3-28-2011)
    Next Visit
    No
    Example 2
    CSV File Text:     ^160/90 (3-28-2011)^Due Now^Yes^
    InDesign Table:
    Measure
    Your Goal
    Your Results
    Next Test?
    Contact Doctor?
    Blood Pressure
    < 130/80
    160/90 (3-28-2011)
    Due Now
    Yes
    Thanks!
    B. Mark Hooten
    Medical Media, Mail Room, Print Shop
    O k l a h o m a  C i t y  V A M C
    Have you considered programming the database application to perform the logic tests, combine the data with the appropriate InDesign tagged text markup, and output the result as an InDesign tagged text file in .txt format? You can then place the tagged .txt file in a new blank InDesign file.
    Search Google for terms like "InDesign tagged text user guide" without quotes for the tagged text guide and related links. Export an InDesign file as tagged text to get an idea of what's involved. In fact, you can use the tagged text exported from your data merge setup as the basis for what the coded database needs to do. You need to open the tagged text file in a text editor, not in InDesign.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Colour changed after layer merge or layer flatten

    Hi All,
    After making several adjustment layers, the layer merge is performed. However, it is observed that the colour changed after layer merging. It is confirmed with the histogram. This phenomenon also happens in layer flatten. Any solution?

    Not sure if this is related, but a previous post had color shift when he converted from RGB to any other profile and then back to RGB. Figured it was a rendering problem. Although he had latest video drivers he went back to previous one and solved the problem.
    By any chance did this start after a driver upgrade?

  • [AS] Trying to change Single Record number under data merge?

    Any help would be great?

    This is where I am trying to go with this:
    tell application "Adobe InDesign CS3"
    tell data merge 1 of document 1
    tell data merge preferences
    set record selection to all records
    set records per page to single record
    set record number to 3--or any number or i value I want to repeat with
    end tell
    end tell
    tell document 1
    tell data merge properties to merge records--and merge that one number
    end tell
    end tell
    Setting the record number actually changes the field for single record but when I try to merge said number it does all the records. I am sure its an ordering thing but it is still causing some head scratches. You've all been really helpful with an area that doesnt seem to be detailed anywhere.
    Any help would be great. Thanks.

  • Applying Bolds and Italics while doing a Find/Replace on Data Merged content

    Hi,
    Wonder if you kind knowledgeable folks can help me with a Find/Replace question.
    I am doing a data merge of a book contents into indesign, where my data merge file is a straightforward text csv file which is tab delimited. I have two (almost similar) things I would like to do to specific parts of the text but don't know how to achieve this. 
    -  Firstly, I would like to preserve words/sentences with an 'italic' form but this is obviously lost in a csv file.  Is there anyway I can mark these words in order that a find/replace can make this word italics.  Im hoping there is a solution which resembles something like this;
    eg.  Book content is "The Word Italic needs to be adjusted".
    Original content is amended to be "The Word $Italic$ needs to be adjusted", so that a dollar sign encapsulates the word to be made Italic.
    Then I am able to data merge the csv file and somehow do a find/replace of words/sentences which are encapsulated by the dollar sign.  Thus, doing a find/replace of all words/sentences which satisfy this condition and then apply italics to all words between the dollar signs.
    - My other issue is I am using the '|' character in my text to determine the paragraph seperators.  I then do a find/replace after importing the text to replace all instances of '|' to the paragraph seperator (a kind of $ symbol, a representative character from the pop-up menu to the right of the Change To box). This works fine, but I'd like to make the paragraph seperator to be a BOLD format so that it can distinguish better the seperating sections of text.
    But this is different from my 'italics' issue above since I am trying to apply a BOLD format to the 'Change to' character, rather than something which exists in my original csv.
    Hope I make sense but I'd be happy to provide screenshots etc (when I get home )
    Best Rgds
    L

    two solutions.
    for the italic solution, i'd say the OP answered his own question with one exception - don't use dollar symbols, instead use = or another character which isn't reserved by GREP.
    the solution i would use for italics would be a GREP search once the merge is complete. have a look at the picture to see what i've done.
    the second solution: GREP styles.
    this assumes that the text will have a paragraph style assigned to it. make a character style called BOLD and within that style, the only thing to change is within basic character formats, make the font style bold. could even make the character another colour such as cyan so it is more easily idenfiable.
    next, go to the paragraph style options, go to GREP styles and match the following screengrab
    the advantage with a GREP style is that once the pipe symbol (|) is replaced, its bold GREP style character formatting is lost; and it means less post processing and no need for a second search of the text - it's all live.

  • Data Merge: Frame background color?

    Hi everyone.
    I'm not sure if this is possible, but I'm trying to figure out a way to data merge a value to trigger the background color of a shape frame to change to another color to appear highlighted. I can already achieve this by saving out an image to match the specs of the shape I'm currently using, but for the sake of future projects and other applications I thought I would ask anyways. The document I'm merging is rather large and there will be a lot of colored shapes in the mix. Adding extra images per page will probably bump my file size a little bit - but probably not a significant amount because the shapes are pretty small.
    An example of how it looks with images:
    [merged image] [merged image shape (highlighted yellow color)] Master Text [merged text] [merged text] [merged text]
    [merged image] [merged image shape (regular grey color)] Master Text [merged text] [merged text] [merged text]
    I was thinking maybe I could use some kind of GREP style to trigger it? But I don't know if background color can be tweaked like that.
    Thanks in advance!

    GREP styles only work within paragraph styles which have character styles based on GREP queries. it can't call information about the frame it's in, only the text it is applying formatting to.
    However, I think I have a solution. draw two frames - one with a variable colour, and one with a variable picture. center them over each other and make a spreadsheet which assigns a variable pic to the variable pic frame; and a variable coloured pic to a variable colour frame.
    i've linked to an example that i've just quickly made up:
    http://colecandoo.files.wordpress.com/2011/11/bgrndchange.pdf
    to see how this was done, go to the paperclip in the bottom left of the PDF to get to the attachments.

  • How Do I get data merge to work without creating duplicate pages in a single page native file?

    I've called Adobe about this and they indicated it was some kind of setting that needed to be changed in InDesign, but wouldn't tell me how to do it unless I paid for an "incident pack" and talked with technical support.
    Problem: I have a single page document in InDesign CS5. It's a direct-mail postcard with large high-res images and complicated graphics on it. I want to merge a list of recipients names/addresses from Excel with this single-page design. Excel document has 2,000 names in it.
    I successfully create the merge using InDesign's data merge feature, but it creates a new InDesign document with 2,000 pages in it. Each page is a duplicate of my original file, but with different addresses on each page. Because of the multiple records and the high res images it has created 2,000 duplicates of - InDesign crashes. It also took about 4 hours to do the merge.
    There has got to be a better way to merge data w/o it created the same page over and over again.
    I can't make a pdf to solve this problem becasue I have to work with an in-house printer and they do a poor job of printing from pdf. So, I always send them native files. This printer does not have variable data software. However, if that is the fast and easy solution to this problem - I will force them to purchase it.
    Any advise or solution to this problem would be appreciated. Is there a setting in InDesign that needs to change so it doesn't repeat the single page design 2,000 times and cause InDesign to crash?
    Thank you.

    That's exactly how Data Merge works. If it's on the page, it gets duplicated. 2000 records is a lot, so I'm not sure if the images or the sheer number is what's slowing things down.
    One thing you can try is to moove everything EXCEPT the merge placeholders to a master page, then assign the [None] master to the page with the placeholder anbd do the merge. Change the master to the one with your static content after the merge. That might speed up the merge, but it won't do anything for the file being 2000 pages that each has to RIP for printing. The best way to deal with this is to find a printer who can do VDP printing and give him the template file and your data file, and let him do the merge in the print stream.

  • How can I use data merge, within a master, within a book?

    Hi all,
    I am producing an 84pp catalogue for multiple brands.
    I have it set up as:
    1x .indd document per spread
    Master styles within one .indd document for black text, white text etc.
    Book setup to contain all of the .indd files to make up the 84pp book
    Now, my problem is I have to change the footer text and references depending on the brand, so I can have the footers saying 'Call Brand A on 123 4567' or 'Call Brand B on 567 1234' and have various in-text references change from Brand A to Brand B and vice versa.
    I have a data merge on each of the masters in my .indd style source looking at a simple .csv of:
    Brand Name
    URL
    Phone Number
    Brand A
    www.branda.com
    0800 123 4567
    Brand B
    www.brandb.com
    0800 567 1234
    This works fine on the masters within the source .indd.
    But, when I close this master style source and go into another .indd document within the book (after synchronising) I see the <<Brand Name>> container but, when I export the documents it does not populate the book with the data - it keeps the containers.
    Obviously with a normal in-document Data Merge you'd click 'Create Merged Document' but I don't want to export each page, and I have PDF print presets / .joboptions file with settings for the book.
    Any advice on how to get this to work?
    Thanks!
    Andy

    I'm not really following the workflow here, but this seems like it might be better suited to Conditional Text than to Data Merge.

  • [CS5.5/6] - XML / Data Merge questions & Best practice.

    Fellow Countrymen (and women),
    I work as a graphic designer for a large outlet chain retailer which is constantly growing our base of centers.  This growth has brought a workload that used to be manageable with but two people to a never ending sprint with five.  Much of what we do is print, which is not my forte, but is also generally a disorganized, ad-hoc affair into which I am wading to try to help reduce overall strain.
    Upon picking up InDesign I noted the power of the simple Data Merge function and have added it to our repetoire in mass merging data sources.  There are some critical failures I see in this as a tool going forward for our purposes, however:
    1) Data Merge cannot handle information stored and categorized in a singular column well.  As an example we have centers in many cities, and each center has its own list of specific stores.  Data merge cannot handle a single column, or even multiple column list of these stores very easily and has forced us into some manual operations to concatenate the data into one cell and then, using delimiter characters, find and replace hard returns to seperate them.
    2) Data Merge offers no method of alternate alignment of data, or selection by ranges.  That is to say:  I cannot tell Data merge to start at Cell1 in one column, and in another column select say... Cell 42 as the starting point.
    3) Data merge only accepts data organized in a very specific, and generally inflexible pattern.
    These are just a few limitations.
    ON TO MY ACTUAL DILEMMA aka Convert to XML or not?
    Recently my coworker has suggested we move toward using XML as a repository / delivery system that helps us quickly get data from our SQL database into a usable form in InDesign. 
    I've watched some tutorials on Lynda.com and havent yet seen a clear answer to a very simple question:
    "Can XML help to 'merge' large, dynamic, data sets like a list of 200 stores per center over 40 centers based off of a single template file?"
    What I've seen is that I would need to manually duplicate pages, linking the correct XML entry as I go rather than the program generating a set of merged pages like that from Data Merge with very little effort on my part.  Perhaps setting up a master page would allow for easy drag and drop fields for my XML data?
    I'm not an idiot, I'm simply green with this -- and it's kind of scary because I genuinely want us to proceed forward with the most flexible, reliable, trainable and sustainable solution.  A tall order, I know.  Correct me if I'm wrong, but XML is that beast, no?
    Formatting the XML
    Currently I'm afraid our XML feed for our centers isnt formatted correctly with the current format looking as such:
    <BRANDS>
         <BRAND>
              • BrandID = xxxx
              [Brand Name]
              [Description]
              [WebMoniker]
              <CATEGORIES>
                   <CATEGORY>
                        • xmlns = URL
                        • WebMoniker = category_type
              <STORES>
                   <STORE>
                        • StoreID = ID#
                        • CenterID = ID#
    I dont think this is currently usable because if I wanted to create a list of stores from a particular center, that information is stored as an attribute of the <Store> tag, buried deep within the data, making it impossible to 'drag-n-drop'. 
    Not to mention much of the important data is held in attributes rather than text fields which are children of the tag.
    Im thinking of proposing the following organizational layout:
    <CENTERS>
         <CENTER>
         [Center_name]
         [Center_location]
              <CATEGORIES>
                   <CATEGORY>
                        [Category_Type]
                        <BRANDS>
                             <BRAND>
                                  [Brand_name]
    My thought is that if I have the <CENTER> tag then I can simply drag that into a frame and it will auto populate all of the brands by Category (as organized in the XML) for that center into the frame.
    Why is this important?
    This is used on multiple documents in different layout styles, and since our store list is ever changes as leases end or begin, over 40 centers this becomes a big hairy monster.  We want this to be as automated as possible, but I'd settle for a significant amount of dragging and dropping as long as it is simple and straightforward.  I have a high tollerance for druding through code and creating work arounds but my co-workers do not.  This needs to be a system that is repeatable and understandable and needs to be able to function whether I'm here or not -- Mainly because I would like to step away from the responsibility of setting it up every time
    I'd love to hear your raw, unadulterated thoughts on the subject of Data merge and XML usage to accomplish these sorts of tasks.  What are your best practices and how would you / do you accomplish these operations?
    Regards-
    Robert

    From what I've gleaned through watching Lynda tutorials on the subject is that what I'm hoping to do is indeed possible.
    Peter, I dont disagree with you that there is a steep learning curve for me as the instigator / designer of this method for our team, but in terms of my teammates and end-users that will be softened considerably.  Even so I'm used to steep learning curves and the associated frustrations -- but I cope well with new learning and am self taught in many tools and programs.
    Flow based XML structures:
    It seems as though as long as the initial page is set up correctly using imported XML, individual data records that cascade in a logical fashion can be flowed automatically into new pages.  Basically what you do is to create an XML based layout with the dynamic portion you wish to flow in a single frame, apply paragraph styles to the different tags appropriately and then after deleting unused records, reimport the XML with some specific boxes checked (depending on how you wish to proceed).
    From there simply dragging the data root into the frame will cause overset text as it imports all the XML information into the frame.  Assuming that everything is cascaded correctly using auto-flow will cause new pages to be automatically generated with the tags correctly placed in a similar fashion to datamerge -- but far more powerful and flexible. 
    The issue then again comes down to data organization in the XML file.  In order to use this method the data must be organized in the same order in which it will be displayed.  For example if I had a Lastname field, and a Firstname field in that order, I could not call the Firstname first without faulting the document using the flow method.  I could, however, still drag and drop content from each tag into the frame and it would populate correctly regardless of the order of appearance in the XML.
    Honestly either method would be fantastic for our current set of projects, however the flow method may be particularly useful in jobs that would require more than 40 spreads or simple layouts with huge amounts of data to be merged.

  • Variable text files in CS 5.5 data merge

    I have a document that I need to change the text in the document based on a variable in the data file that is being used for the data merge. For example if the are in group A the get letter from text document A, if they are in group B they get the letter from text document B.
    Can the data merge in CS 5.5 do this?

    not with text and not by itself, but a solution is workable.
    indesign's data merge can't place text files as if they were merging pictures, but it can place pictures from jpg, eps, pdf... if the text which changed was a picture, say a PDF, then this would be fine.
    as to telling data merge what is variable, indesign won't parse the data as such... it'll just put the data wherever the placeholders were. if you want if/else statements, these need to be done in the excel file first prior to saving as a text file for indesign.
    so yes, what the OP wants is do-able, but not "off of the shelf" - some manipulation in excel is required.

  • Data Merge not picking up all data fields

    Hi,
    I've been having a problem, posted here: http://forums.adobe.com/thread/1217090
    Essentially, I have been using the script 'CSV2Tables' to prepopulate simple 2 column tables with information drawn from a CSV data source.
    The tables consist of a title, and a block of information about that specific subject. Many of the blocks of information I am importing also contain data tags (<<DataTag>>)
    The plan is to use CSV2Tables to populate the tables, then change data source and run a normal ID Data Merge to replace all of the <<tags>> within the tables with information from a second CSV data source.
    The problem is, CSV2Tables is importing the data and prepopulating the tables just fine, but the data tags that are found within each body of text are being picked up as plain text (as Peter Spier has pointed out, they are being drawn from a plain text stream rather than being dragged from the Mail Merge panel) so when I try to run the ID Mail Merge, none of the fields are found within my document.
    My question is - is there a method, or script available out there that can essentially do a Find/Change within a document, and replace plain text that appears like this <<PlainText>> with a Data Tag that is recognised by ID, which will allow me to run a Data Merge?
    I have been told to check out some of the commercial plugins available out there, but registering and setting up demo's would require me to contact our IT provider for each, and that would be an exhaustive process.
    Any help is much appreciated.

    Hi,
    is modyfied
    Array.prototype.find = function (string) {
        for (var s = 0; s < this.length; s++)
            if (this[s] == string) return s;
            return -1;
    var mFrames, mFile, mDoc, mFields, mFieldsNames, mStory,
         mPlainTxt, mNameToCompare, mField_ID;
    // edit this with proper .csv path
    mFile = File(Folder.myDocuments + "/" + "Merge.csv");
    mDoc = app.activeDocument;
    mDoc.dataMergeProperties.selectDataSource(mFile);
    mFields = mDoc.dataMergeProperties.dataMergeFields;
    mFieldsNames = mFields.everyItem().fieldName;
    mFrames = mDoc.textFrames.everyItem().getElements();
    for (var i = 0; i < mFrames.length; i ++) {
        if (!mFrames[i].name.match(/TF\d*$/) ) continue;
        // script assumes a targered text boxes are named like: TF1, TF2...
         // (TF plus any integer) or just TF (no integer)
        // - they could have the same name
        // any other name exludes frame from this loop
        mStory = mFrames[i].parentStory;
        app.findGrepPreferences = null;
        app.findGrepPreferences.findWhat = "<<.+?>>";
        mPlainTxt = mStory.findGrep(true);
        for (var k = 0; k < mPlainTxt.length; k++) {
            mNameToCompare = mPlainTxt[k].contents.slice(2,-2);
            mField_ID = mFieldsNames.find(mNameToCompare);
            if (mField_ID > -1) {
                  mField = mFields[mField_ID];
                mDoc.dataMergeTextPlaceholders.add (
                    mStory,
                    mPlainTxt[k].insertionPoints[0],
                    mField
            mPlainTxt[k].remove();
    script assumes a targered text boxes are named like:
    TF1, TF2... (TF plus any integer) or just TF (no integer) -
    - they could have the same name.
    Jarek

  • Indesign CS3 Data Merge "Merge Records" Command. Help?

    I'm looking to automate the merging of a mountain of records. I have 587 tab-delimited text files with 40 records each. I want to process these via Data Merge using a single pre-designed template with built-in placeholders and variable data fields, including a variable barcode graphic. In the end, I want to create 704 multi-page, 6-up per page, indesign files with merged data, and 704 multi-page PDFs.
    Here's where I am at. Using a combination of AppleScript, TextWrangler and InDesign CS3, I am able to set up a loop where I can open the single template, save it to a new file with a new name, change its data source to the appropriate text file, and as a test, make a PDF of the template using the correct export preset. What I cannot seem to do is get the template to perform a "Create Merged Document...".
    In InDesign CS3's AppleScript dictionary there is a command called "Merge Records" under the Data Merge section. It appears to do exactly what I am after. But when I try to use it (and the good Lord knows I have tried numerous permutations), it only returns errors like "Adobe InDesign CS3 got an error: active document doesn't understand the merge records message."
    Anyone know what I am doing wrong? I have set up a separate AppleScript for testing purposes that opens up the template, saves it under a new name, and attempts a "merge records" command. Here it is. Maybe someone smart out there can tell me what I am doing wrong.
    set templatePath to "Welch_Jobs:0_JOBS:280019_Churchill:WPC FILES:Workup:280019_6up_master template.indt" as text -- the main template file that will be modified, saved with a new name, then merged with its data to create a new merge file
    set newTemppath to "Welch_Jobs:0_JOBS:280019_Churchill:WPC FILES:Workup:goody.indd" as text
    tell application "Adobe InDesign CS3"
    open file templatePath
    tell active document
    save to newTemppath
    merge records
    end tell
    end tell
    I have this feeling that this is a command that is actually unsupported. Google searches have been fruitless except for one poor soul who can't get it to work either. I have, however, seen that a similar JavaScript command exists called "DataMerge.mergeRecords". If it is impossible to do this via AppleScript, is it possible to make a JavaScript that will do it, and access the JavaScript with a "do script" command in the main AppleScript? If so, how would I accomplish this? What whould the JavaScript look like, and where do i need to put it?
    I would greatly appreciate any help you, dear reader, can give me on this.

    Well, did you look at the dictionary?:
    merge recordsv : Merges records and produces an optional overset report.
      merge records
    data merge
        output overset report file alias or
    text] : The path to the file in which to store the overset report.
    Note also that it's part of the Preferences Suite, not the Datamerge suite. Do you see differently?
    Anyhow, you're clearly not calling it with a data merge parameter.
    I also have a suspicion that it needs to not be inside a "tell active document" but it probably doesn't matter.
    But my AppleScript is rusty.

Maybe you are looking for