PATH for Open File dialog?

PATH for Open File dialog?

5
NewbieNewbie
5

    Sep 22, 2008#1

    Is there any way to set up UE to search through a defined path in the Open File dialog? For example, if I have a path such as .:src:src/inc, I'd like UE to look in ".", then "src", then "src/inc" for the file. :P

    Thanks,
    Steve

    6,675585
    Grand MasterGrand Master
    6,675585

      Sep 23, 2008#2

      So you want to specify what is the current working directory for UltraEdit?

      There are several options how UltraEdit should handle the current working directory. See

      Advanced - Configuration - File Handling - Load
      Advanced - Configuration - Directories

      and read the help for these 2 configuration dialogs.

      And when a project is open, the specified project directory in the project settings is also taken into consideration to find a file with a relative path - see help page titled Output Window command.
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        Sep 23, 2008#3

        Thanks Mofi, but it isn't the current directory I need to specify, it is an actual PATH list. So if I hit File / Open, and type "foo.inc", if the actual file is ".\inc\foo.inc" and my PATH is ".:inc", I'd like to just specify "foo.inc" and have UE find the file. My example sounds trivial but I am working on a system that uses thousands of files and a PATH of about 20 dirs. to invoke code - so I'm constantly having to search for files in the OS before I can tell UE where to find them.

        Steve

        262
        MasterMaster
        262

          Sep 23, 2008#4

          No UE (Windows) is not able to search multiple relative or even absolute file paths for a file in the file open dialog.

          But I have a project with source code scattered across several folders. So I made a small script to easily open files from the desired folder. But my luck is that specific extensions is placed in certain folders so depending on the file name I know which folder to open from.

          Here is a simplified version of my script:

          Code: Select all

          var myRootPath = "C:\\MyProject\\";
          
          var selectProgram;
          if (UltraEdit.activeDocument.isSel()) {
            selectProgram = UltraEdit.activeDocument.selection;
          }
          else {
            selectProgram = UltraEdit.getString("Enter filename to open:",1);
          }
          
          if (selectProgram.length==0) {
            // no filename entered or selected
          }
          else {
            if (selectProgram.indexOf(".jsp") > 0) {
              UltraEdit.open(myRootPath+"jsp\\"+selectProgram);
            }
            else {
              if ((selectProgram.indexOf(".java") > 0) || (selectProgram.indexOf(".class") > 0)) {
                selectProgram = selectProgram.replace(".class",".java");
                UltraEdit.open(myRootPath+"java\\"+selectProgram);
              }
              else {
                UltraEdit.open(myRootPath+"misc\\"+selectProgram);
              }
            }
          }