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
-
“Stop”
Ritual De Lo Habitual
Jane's Addiction
06/10/10 14:53 -
“I Turned into a Martian”
Boxset Collection 1: Plan 9
Misfits
06/10/10 14:51 -
“Nothin' To Live For”
Problematic
All
06/10/10 14:50