UndoModes.AUTO_UNDO


hi guys!

 

while trying debug missbehaving script camed across undo mode.

can tell me do? how similar/different form undomodes.entire_script ?

when running script within undomode.auto_undo, id add script's undo previous undo item on undo stack. if there no previous undo item on stack, appears not able undo script's action.

 

for example, after manually create new rectangle, edit > undo displays "undo add new item".

 

if run script (while in auto undo mode) that  turns off visibiltiy of layer, edit > undo still display "undo add new item"--even after script has run.

 

if edit > undo ("undo add new item") after script has run, not creation of new rectangle undone, layer settings. undo layer settings happen along created undo.

 

here's script can run after create new rectangle (or whatever) , see how not affect top item of undo stack after run. after running script below, see script's changes undone along previous undo.

 

// make sure frontmost doc has layer named, "layer 1" before running script. app.doscript(changelayerfunc, scriptlanguage.javascript, undefined, undomodes.auto_undo, undefined); function changelayerfunc() {      app.activedocument.layers.item("layer 1").visible = false; } 

 

i hope helps!

 

-- jim

www.premediasystems.com



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Adobe Acrobat Pro , Terminal Server Use

Thread: transmission-daemon isn't playing nice: "409: Conflict"

Thread: gpg: Conflicting Commands