2 Replies Latest reply on Nov 8, 2012 10:20 AM by Paul Riggott

    Get the folder path and exclude the filename.


      Hi guys,


      I am writing a ps script (in javascript) which involves the user navigating to and then selecting a file. The path of the file is then saved to a text file 'path.txt' and is called upon later in the script - for various reasons.


      For example:


      At the moment, when the file is navigated to and then selected, it will write to the text file:




      Up until now that is what i needed it to do, but now i need a slight modification.


      What i need is for it to just write:




      - Excluding the filename.



      The code that i am currently using for this, is as follows:


      UpdatePaths.onClick=function() {


           saveFile = File.openDialog("Select the file you are working on:", "All Formats: *.*");

           var txtPath = new File("C:\\path.txt");







      Hopefully this is just an easy tweak?


      Any help would be much appreciated.


      Many thanks,