Script for automatic placement of several text files?

An editor I work with is slowed by a change to their workflow. Maybe there's a whole script for help? I looked but can not find, so I post here.

Old workflow: Designers would be "automatic formatting" a single Word doc with all the preliminary pages (sometimes > 10 sections of diff.) and chapters and endnotes in a model book.

New workflow: The Word doc is now divided into 30-40 InCopy files, always destined to a single InDesign layout doc (The InCopy files were created from a Word doc marked by a different system, so that they are all new to the InDesign user.)

Y at - it a script which, according designers load a square slider with 30-40 (in the right order) files, which will allow them to simple-click on page 1, and InDesign will place one after the other files, autoflowing necessary? They still need them to be placed in individual InCopy files (so would not help concatenate Prime). I don't think that there is never a case of 2 stories being on the same page.

Thank you

AM

Hey AnneMarie,

This script allows you to select a bunch of files and will try to place them, one by one, in your InDesign document. It will be auto-flux them according to the needs (but be careful because standing in excess of problems - because the script does not test for this).

I tested with a lot of property, but not with InCopy files because I did not. If they are adjustable as Word documents, the script must run end.

Let us know if everything works correctly for you.

// BS"D
// Multi-file auto-place
// An InDesign Script by Ariel, (c) Id-Extras.com, 2014
// This script will allow the user to select a bunch of placeable files (Word docs, etc.)
// It will then attempt to place and auto-flow all the selected files.
// The script will start from page 1 of the active document
// and keep adding pages as needed.
// It will add text frames as needed, within the margins of the page.
// IMPORTANT: There is no error-checking for perpetual overflow!!!
// So, if something you're trying to place cannot fit within the margins,
// The script will continue adding pages to InDesign until it crashes.
// To quit the script, press ESC.
var myDoc = app.activeDocument,
 myFiles = File.openDialog("Select files to place...", undefined, true),
 i,
 currentPage = myDoc.pages[0],
 prevFrame,
 myFrame;

for (i = 0; i < myFiles.length; i++){
 myFrame = addFrame(currentPage);
 myFile = myFiles[i];
 try{
  myFrame.place(myFile, false);
 }
 catch(e){
  alert("Unable to place file: "+myFile, "Multi-file auto-place");
  continue;
 }
 while (myFrame.overflows){
  currentPage = addPageAfter(currentPage);
  prevFrame = myFrame;
  myFrame = addFrame(currentPage);
  prevFrame.nextTextFrame = myFrame;
 }
 currentPage = addPageAfter(currentPage);
}
function addFrame(aPage){
 var pageMargins = aPage.marginPreferences,
  aFrame = aPage.textFrames.add(),
  areFacing = app.activeDocument.documentPreferences.facingPages,
  myTop = aPage.bounds[0]+pageMargins.top,
  myBottom = aPage.bounds[2]-pageMargins.bottom,
  myLeft = aPage.bounds[1]+pageMargins.left,
  myRight = aPage.bounds[3]-pageMargins.right;
 //When document.documentPreferences.facingPages == true,
 //"left" means inside; "right" means outside.
 if (areFacing && aPage.side == PageSideOptions.LEFT_HAND){
   myLeft = aPage.bounds[1]+pageMargins.right;
   myRight = aPage.bounds[3]-pageMargins.left;
 }
 aFrame.geometricBounds = [myTop, myLeft, myBottom, myRight];
 return aFrame;
}

function addPageAfter(aPage){
 return myDoc.pages.add(LocationOptions.AFTER, aPage);
}

Tags: InDesign

Similar Questions

  • Search for change through an external text file

    Hello people

    I'm pretty little in InDesign scripting so could you please look at this.

    How can I change any text field in the Indesign CS3 text file document.

    I find change script, but for each InDesign file specific text in the document is assigned.

    So, whenever I need to change find change the GREP property which is also repetitive work. Is it possible to find information about the changes must be extracted from the external text file.

    Many of the tanks in advance

    In the FindChangeByList script, you can customize the myFindFile (myFilePath) {...} function to search the FindChangeList text file in the location of the document rather than on the location of the script. This is an example. The question is: given a document, where you will have the corresponding FindChangeList?

    @+

    Marc

  • How LR for automatically write metadata to the file?

    Hey guys,.

    I looked through all the settings already, maybe I'm blind, but is there a way to tell LR to automatically write metadata to the file after changing the metadata tags?

    Edit-> settings->-> writing metadata catalog changes automatically on XMP

  • Waiting for automatic placement at the end.

    Hello

    I have a simple script that puts a BCTI file in a textframe and then saves the document.

    The target document is set to "automatic formatting" the happy ICML, and it creates pages as needed. It works very well.

    However the save operation does not wait for the autoflow finish. If the saved document has a page with overset text.

    It must have 2 pages and any overset text.

    If I leave the page open in InDesign, after a very short time, a new page is added, and the text is autoflowed.

    How can I get InDesign to wait for the "automatic formatting" after the operation before you save the file?

    Script:

    myDocument var = app.activeDocument;
    myPage var = myDocument.pages.item (0);
    var myTextFrame = myPage.textFrames.itemByName ("mainBody");
    myTextFrame.place (File ("page1.icml"));
    myDocument.save (File ("document1.indd"));

    Thank you.

    You probably want to remove the idle task, once completed. To set the sleep on 0:

    gDocsToSave = [];// Add docs that need to be saved to this array.
    var task = app.idleTasks.add({sleep:100});
    task.addEventListener(IdleEvent.ON_IDLE,saveDocs);
    
    function saveDocs(ev){
         var doc;
         while(doc = gDocsToSave.pop()){
              doc.save();
         }     ev.target.sleep = 0;}
    

    Substances

  • Script for application of hyperlinks to text

    Hello

    I made a people directory document in InDesign using the data merge. Each person has information on access to its URL to social networks (LinkedIn, Twitter).

    Is it possible to do a script that search the InDesign document for all channels that looks like this:

    LinkedIn profile: http://a-very-long-URL

    and transforms them in all the LinkedIn profile , but with the URL applied as a hyperlink?

    If it's easier to search/replace operation I could mark the string without delimiters before executing the script, to avoid complex URL detection scripts. Maybe something like this (Markdown style): [LinkedIn profile] (http://a-very-long-url/)

    Thank you!

    Hello

    Quick snippet, try...

    var doc = app.activeDocument;
    // get URL
    app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.findWhat = '(?i)(?<=LinkedIn Profile: )(https?|www)\\S+\\>';
    var mURL  = doc.findGrep();
    // get Texte
    app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.findWhat = 'LinkedIn Profile:';
    var mSource  = doc.findGrep();
    
    for (var k = 0; k 		   
  • script for automatic export daily

    Hello
    I need a script under linux for autamatic export everyday.pls someone send the script to do this.


    Thanks and greetings
    Srinivas

    Create an export.sh file and put it in the file using the vi editor and save it

    "Export DD ='date + %m %d hour %M"
    Export DMP_DIR = / u01/export
    Export EXP_DMP_DIR = / u01/export/expdump
    Export EXP_LOG_DIR = / u01/export/explogs

    file name of user and password exp = ${ORACLE_SID} EXP_DMP_DIR/full_$ _export_$ {DD} full .dmp = log y = $EXP_LOG_DIR/full_$ {ORACLE_SID} _export_$ {DD} .log statistics = none filesize = 1048560000 direct = y

    This script will create new dump file every day with the date added in the name of the file

    You can schedule this script using crontab

  • Script for the use of rich text change

    I use the script below to add instructions for the use of Textfields. I would like to do the same thing with textfields in the rich text format, but this script no longer works when I put in the field to accept rich text. Can you tell me how to change the script, so it does not work in a ttext field that allows the user to enter rich text?

    MeetingMinutes. #subform [2]. Attendees::Initialize - (JavaScript, client)

    this.execEvent ("exit");
    This.format.Picture.Value = "null {'}" + this.assist.toolTip.value + ""} "";


    MeetingMinutes. #subform [2]. Attendees::Enter - (JavaScript, client)

    this.fontColor = "0,0,0";
    This.font.posture = "normal";


    MeetingMinutes. #subform [2]. Attendees::exit - (JavaScript, client)

    If (this.isNull)
    {
    this.fontColor = "153,153,153";
    This.font.posture = "italic";
    }


    MeetingMinutes. #subform [2]. Attendees::prePrint - (JavaScript, client)

    This.format.Picture.Value = "";


    MeetingMinutes. #subform [2]. Attendees::postPrint - (JavaScript, client)

    This.format.Picture.Value = "null {'}" + this.assist.toolTip.value + ""} "";

    Thank you

    -Don

    Hi Don,

    Similar to your script above, but try this in the event enter:

    if (this.rawValue === this.assist.toolTip.value) {
              this.rawValue = "";
    }
    

    and then exit on the event:

    if (this.rawValue === null) {
              this.rawValue = this.assist.toolTip.value;
    }
    

    ALTER depending on the initialize event and formatting, etc.

    Niall

  • Question in regards to the script for automatic filling check box

    Hello everyone.  First of all, let me say a big thank you to all the users, but also the admins of this forum.  As a user of LiveCycle newbie, I learned an incredible amount of research on the forum and reading of others.  Now, to my current question...

    I use a custom form created in LiveCycle ES 8.2 and wonder how to empower a checkbox to fill automatically (IE. 'on') based on a number entered in a numeric field by using a range of criteria.  To be more precise, I have (5) checkboxes that will be labeled as follows:

    Name: CheckBox1 < 500

    Name: CheckBox2 500-999

    Name: CheckBox3 1 000-1 499

    Name: CheckBox4 > 1 500

    Name: Checkbox5 no

    I don't want only a SINGLE checkbox auto fill based on a certain number I enter the numeric field (called "NumericField1").  For example, if I enter "889" number, I want only CheckBox2 AutoComplete in.  Not sure what script to use in the Script Editor for this.  Any help would be greatly appreciated.  Thank you very much in advance.

    MJ

    You are welcome. I added a second numeric field. NF1 is entered by the user option. NF2 is calculated field read-only to mimic your form. NF2 simply takes the value of nf1. I moved the logic of radio button in the radio button exclusion group calculate event to produce the results below. I think that's what you're after. The updated form is attached.

    Steve

  • Re: VBS Script for automatic integration of multiple channels

    Hi brad,

    Thanks for the reply.

    I've attached an example of data to analyze.

    Auto steps as follows:

    Select Auto would have all channels starting by ' or a message box to manually select.

    divide the channel by 3600000, then integrate - store the result in a new string with the name of the original but added channel with "_Ah".

    Auto maxvalue for each new channel and maxvalues sum all together...

    I want to auto select a range of values to analyze, but I'll try to do what I'm learning!

    Concerning

    Karoline

    Hi Albert,

    Here is a VBScript script that does what I understood you ask: it includes all the "D *" channels, appoint new channels with a suffix "_Ah" and each divides by 3600000, finally in summary all the maxima of the built-in channels.  Note that some integral chains have a maximum negative, so there are some positives and negatives cancel past in this amount.

    Sun Group, chains, TimeChannel, DataChannel, NewChannel, sum
    Set Group = Data.Root.ChannelGroups (1)
    Set TimeChannel = Group.Channels (1)
    Presets = Data.GetChannels (Group.Name & "/ D *")
    Call Group.Activate
    For each DataChannel in channels
    Call ChnIntegrate (TimeChannel, DataChannel, DataChannel.Name & "_Ah")
    Set NewChannel = Group.Channels (DataChannel.Name & "_Ah")
    Call ChnLinScale (NewChannel, NewChannel, 1/3600000, 0)
    Sum = sum + CMax (NewChannel)
    Next ' DataChannel
    Sum of MsgBox

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Need help to create a Script for the labelling of Finder of Indesign files

    Try to find a way to have a script run in InDesign CS4, who tagged a RED text file once it's been imported into InDesign.

    Import multiple text files in an InDesign template. Since there are several text files in the same folder, it must somehow 'delineate' that we have imported this file and move to the next import. I created a 'service' with a keyboard shortcut Automator to label the Red file in the finder, but it would be great if we could have this occurs automatically after we imported in InDesign.

    If import us the text wrong by accident and it gets missed in fermentation, it costs us a lot of money with the printer.

    Thanks for all the ideas.

    Jim

    At its heart, it's what you want to do.

    tell application "Adobe InDesign CS4"
         set placeFile to choose file
         tell active document
              tell selection
                   --Assumes you have preselected the picture or textbox to place file in
                   place placeFile
              end tell
         end tell
    end tell
    tell application "Finder"
         set label index of placeFile to 2
    end tell
    

    You can expand on it pretty easily. The script for InDesign dictionary must be in the Library palette in the Applescript editor and the docs for Applescript are all online.

    If you need further assistance, you may wish to ask someone to write a complete script for you to spec for real moneyz.

    Best o ' luck!

    Eric.

  • several text to an excel workbook files

    Hello

    I know this question has been asked and answered many times and I read a lot of posts about it.

    but none of the previous posts were really able to help me. so, here's my problem:

    I have to be able to prepare several text files and save the content of text files in a new file (text), and then paste this new text file into a new worksheet in an excel template.

    Here's what I did so far, I am able to read the 3 text file and concatenate all 3 files in a new text file, but when I transfer to Excel, it shows only a single file is pasted into the new worksheet in Excel.

    Alternatively, each of these text files spill in a new worksheet, or of several worksheets would be good too, if we do not have concatonate first text files.

    I hope someone can show me the way.

    Thank you all.

    Yes, do the different 'Start' cell each iteration. You can use the "next cell down to the left" If you want your data stacked vertically, or 'next cell up right' to get it stacked horizontally.

  • Can Adobe Pro automatically add the numbers of files?

    In our hospital, we went from Nuance PDF Pro to Adobe Acrobat IX.  The largest surface that we cannot defeat is defining the Adobe as our default printer and sequencing automatically files.  In the PDF of Nuance (DocuCom and ScanSoft) printer drivers, we have been able to change the properties to automatically add flight numbers.  We spent many hours with our support technical (we are a huge institution in many States and countries) and they do not have a solution.  We travel options, is there a way for Adobe Acrobat Pro, put on the numbers that we run PDF print multiple files?  We have not found anything in the literature or by trial and error.

    I assume you mean the creation of PDFs by printing to the Adobe PDF, PostScript printer driver instance, correct?

    If Yes, this instance of printer driver creates a default file to PDF on the base name of the %% Title line comment placed in the PostScript file by the Windows PostScript driver. You can of course change this to what you want in the dialog box file presented to you for the location for the placement of the PDF file.

    What being doesn't say, there is no possibility of embedding to create numbers end automatic or in the case of duplicate file names, either unconditionally.

    If you have an application of your own which is printing with the PostScript driver, programmatically, you can probably force a new name with continuously moving numbers when calling GDI to start the printing process.

    -Dov

  • Problem with unicode text file

    Hello

    I have files of unicode text containing Chinese characters. I'm currently building sides manually using these for a unicode application unicode text files. The manual process shows the 'Success' message, but I'm not able to see the dimensions. I am just able to see a single unknown character.

    Pls help

    Try to open the file in a text editor like Textpad or ultra edit and set the encoding of the file it & save the file. This command sets the BOM that tells other applications to the encoding of the file.

    Note:
    Marker order byte (BOM for short) is a hexadecimal value at the beginning of a file that is used as a 'flag' or 'signature' for coding and/or hexagonal byte order that should be used for the file. With format UTF-8 data, it is normally hex bytes EF BB BF.

    Robb

  • Church Directory Layout - automatic placement

    Is the way in InDesign CS4 for automatic placement of images and names for a religious directory or a directory? Anyone know where I could find a model by chance? Thanks in advance.

    Oddly enough, I'm working on a project of data merge, too.

    Here is the help topic about InDesign on the fusion of data online

    You can also watch here for a podcast for useful vidoe of Michael Murphy

    -mt

  • Is there a limit for research on the function of advanced search for files containing text matching. My search always ends with 500 discoveries but the folder contains several PDF files that match the criteria.

    Hello

    Is there a limit for research on the function of advanced search for files containing a text match? My search always ends with 500 discoveries but the folder contains several PDF files that match the criteria.

    Hi carls76936091,

    Open Acrobat, go to the Edit-> Preferences-> search & check if there is a limit to 500 set, in case if it is to increase it please.

    Kind regards
    Nicos

Maybe you are looking for