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
-
“12:51”
Room on Fire
The Strokes
10/02/08 20:57 -
“Hospital Food”
Electro-Shock Blues
Eels
10/02/08 20:53 -
“Captain Easychord”
Sound-Dust
Stereolab
10/02/08 20:48