home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / OPENSCRIPTFILESINDIRECTORY.SCRIPT < prev    next >
Encoding:
Text File  |  1998-01-06  |  684 b   |  34 lines

  1. !!script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. // This script lets you open all files in a directory tree
  5. // that match the criteria 
  6.  
  7. // This script opens all .script files in the selected directory
  8. // and subdirectories
  9.  
  10. function DoCommand()
  11. {
  12.   var directory = chooseDirectory("Open Files in Directory");
  13.   
  14.   if (directory)
  15.   {
  16.     var files = getDirectoryFiles(directory, "*.script", true);
  17.     if (files)
  18.     {
  19.       var position = files.getHeadPosition();
  20.       while (position.valid)
  21.       {
  22.         var file = files.getNext(position);
  23.         if (file)
  24.         {
  25.           file.open(true);
  26.         }
  27.       }
  28.     }
  29.   }
  30. }
  31.  
  32. !!/script
  33.  
  34.