5 Replies Latest reply on Jan 22, 2015 7:17 AM by gkaiseril

    How to import text from a text file?


      Hi, so I run this code in Document JavaScripts:

      this.importTextData("/Macintosh HD/Users/mdumanska/Google Drive/Invoice Templates/InvoiceNumberSave.txt",0);
      var originalValue = getField("Invoice").value;
      getField("Invoice").value = originalValue + 1;

      Basically I am trying to save the number of invoice in a file and constantly update the invoice number as I open more pdfs.

      This works when I don't specify the path. That's when it asks me for the file.

      However, when I put in the path into the importTextData() function I get this:

      NotAllowedError: Security settings prevent access to this property or method.

      By the way, I am running on a mac.

      I have tried everything at this point changed permissions for the folders, and user trustedFucntions. Nothing works.

      Please help! Thank You