Last active
December 15, 2015 03:49
-
-
Save moluapple/5196971 to your computer and use it in GitHub Desktop.
[Indesign] Reset the window bounds to the same as last time (CS6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#targetengine "keepWindowBounds" | |
(function() { | |
app.addEventListener("afterOpen", setBounds); | |
function setBounds(ev) { | |
var layoutWin = ev.parent, | |
bounds = eval('[' + app.extractLabel('bounds') + ']'); | |
layoutWin.addEventListener("beforeClose", insertBounds); | |
function insertBounds(ev) { | |
try { | |
// save window bounds before any document close. | |
app.insertLabel('bounds', ev.parent.bounds + ''); | |
} catch (e) {} | |
} | |
// set window bounds when a document opened. | |
try { | |
layoutWin.bounds = bounds; | |
} catch (e) {} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment