2 Replies Latest reply on Sep 23, 2017 6:35 PM by moluapple

    Play with addDocumentNoUI

    moluapple Level 4
      var doc = app.documents.addDocumentNoUI();
      $.writeln(app.documents.length) // 0
      
      var t = doc.textFrames.add();
      t.contents = doc.name;
      t.selected = true;
      $.writeln(t.selected) // true
      $.writeln(doc.selection.length) // 1
      
      /*
          
      $.writeln(app.selection.length) // error, no such element
      
      app.paste() // error, no documents are opened. 
      // and you can not duplicate or move items from visible document to the NoUI document.
      app.redraw(); // crush!
      
      */
      
      
      doc.saveNoUI(File('~/desktop/NoUI.ai'));
      doc.closeNoUI();
      
      $.hiresTimer; // It seems with NoUI mode, will take less executing time, need more tests.