Search code examples
javascriptadobe-indesignextendscriptadobe-incopy

How to script InDesign/InCopy to "Check In" and "Check Out" textFrames?


I am not very familiar with InCopy. I keep seeing that it's a separate application, but I only have InDesign CS6 here, no InCopy CS6. Yet I am able to access InCopy functions within InDesign, such as "checking out/in" various textFrames for editing, then refreshing them in the Links panel so they update other textFrames on other pages in the document.

My question is this—How can I use ExtendScript to automate this process?:

  1. InCopy > Check Out a specific textFrame.
  2. Alter the text within it, or its properties, etc.
  3. InCopy > Check In that textFrame.
  4. Refresh the links so that the other InCopy textFrames in the document are updated with the new info.

Any ideas, please?


Solution

  • Do you have any code that you've tried so far?

    I'm taking a stab in the dark here, but I might start off with something like this:

    var story = textFrame.parentStory;
    story.checkOut();
    story.contents += " This is added to the end.";
    story.checkIn();
    story.recompose();
    var linksArr = document.links.everyItem().getElements();
    for (var i = 0; i < linksArr.length; i++) {
        linksArr[i].update();
    }