Other Entries

Log

A Hack for Scripting Revert in InDesign

Apparently InDesign doesn’t have a revert scripting method. In the process of developing scripts, it would be very handy to not have to constantly revert the target file constantly. So I hacked together this little bit of javascript to automatically revert the file at the beginning of a script:

var doc = app.activeDocument;
if (doc.modified)
   {
   var path = doc.fullName;
   doc.close (SaveOptions.no);
   doc = app.open (path);
   }

It requires a document to be open and active, then checks if it’s modified. If so, it grabs the path, closes without saving and reopens it referenced by the original variable.

04/26/07 10:00AM Design Javascript

Recently Played on iTunes

  1. “My Sharona”
    Frat Rock: The '70s
    The Knack
    06/04/11 09:27
  2. “The KKK Took My Baby Away”
    Anthology
    The Ramones
    06/04/11 09:25
  3. “My Sharona”
    Frat Rock: The '70s
    The Knack
    06/04/11 09:24

Last 100 Songs >