4 Replies Latest reply on Oct 19, 2015 6:18 AM by rombanks

    ES does not recognize an environment variable

    rombanks Level 1

      Hello fellows,

       

      On my Win 7 system, I've redefined the HOME environment variable as C:\Users\bnks (by default, it's C:\Documents and Settings\Users\bnks).

       

      I'd like to save an FM file to C:\Users\bnks\Checkout\Test\, so in my extendscript, I've defined the following variable:


      var docLib = "~\\Checkout\\Test\\";


      where the tilde (~) should be parsed by extendscript as the HOME environment variable (according to Chapter 3, “File System Access” in the JavaScript Tools Guide).


      Unfortunately, the tilde is ignored when I try to save the file:

      ...

      var dname = docLib + rName + ".fm";

      doc.Save(dname, saveParams, returnParams);

      ...


      Any idea why this happens?


      Thank you!!!