8 Replies Latest reply on Jan 8, 2015 8:05 AM by Laubender

    AIS CC: how undoing the actions of a JS run via app.doScript

    BillFR2011

      Hello,

       

      AIS CC (9.0)

      I wrote a JavaScript, which I can properly run through app.doScript(UndoModes.fastEntireScript, etc.).

       

      Now, at a given time, I would like to programmatically undo the actions of my own script.

       

      The various resources I have got here (InDesign_ScriptingGuide_JS (CS6), InDesign_ScriptingTutorial, the ExtendScript Toolkit Object Model browser) suggest things (app.undo(), app.documents.item(0).undo(), etc.) which fail, when executed on my AIS CC.

       

      Any idea or tip, on how to undo actions submitted via doScript on AIS CC?

       

      Thanks in advance!

       

      Kind regards,

       

      GB

       

      Snippet:

       

      var main = function()

      {

           // something

      }

       

      app.doScript(

           main,

           ScriptLanguage.javascript,

           undefined,

           UndoModes.fastEntireScript

           ); // << this works perfectly: the actions in the "main" function are executed

       

       

      app.undo(); // << this will fail with "app.undo is not a function"