3 Replies Latest reply on Jun 16, 2017 12:56 AM by huy-long

    How to user Document.importFile() function?

    huy-long

      Hello,

       

      I would like to try out the Document.importFile() function introduced in CC2015.

       

      Illustrator 2015 changes?

       

      CC2015Document.importFile (importFile: File )
      Adobe Illustrator 19 Type Library
      Import the file into current Ai document.
      importFile: Data Type: File

      The file to import in the current document.

       

       

      But I don't know which arguments to pass to the function.

      I tried this code:

       

      var doc = app.activeDocument;

      var file = File('/Users/outcrash/Desktop/Sketches/CM8319_big.svg');

      doc.importFile(file);

       

      But I get "Illegal argument - argument 2"

       

      I tried several variations for the second argument: 1, true, false, null etc...

       

      Looking at the Data Browser in ESTK, the function clearly exists, but there are no arguments shown:

      Screen Shot 2017-06-14 at 5.30.35 PM.png

       

      When i print out the function like this:

      $.writeln(doc.exportSelectionAsAi);

       

      I only get this in the console:

       

      function importFile() {

          [native code]

      }

       

      I also tried stepping into the function by setting a breakpoint, but it wouldn't go into the code.

       

      Has anybody tried that function already and know which arguments to pass?