1 Reply Latest reply on Feb 27, 2012 12:45 AM by Mani_1984

    app.undo not working

    z1k7s33w

      Hi,

       

      I facing some trouble with app.undo(). I call a large script with doScript with UndoMode.Entire_Script and an undo name. The script performs a bunch of actions, one of which adds an item in the undo history named "Set Measure Units". After the doScript call completes, I want to undo all the actions performed by the script. So I call undo in a loop till I reach the doScript action. It looks something like

       

      app.doScript(myScript, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "MyScriptName");

      do {

      app.undo();

      } while (app.undoName != "MyScriptName");


      However, the app.updo() call fails with a message "Unable to undo last action". This happens even if I remove the loop and call app.undo just once. Any clue why this might be happening? Thank you in advance.

       

      -S