EmEditor (text editor) Forum Index
   EmEditor Core Enhancement Suggestions
     open next file in the folder
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
tonne
Posted on: 7/14/2010 12:38 pm
Just popping in
Joined: 11/5/2009
From:
Posts: 4
Re: open next file in the folder
Prev-file version...

// This macro opens the prev ".txt" file in the current folder.
//
sFolder = document.Path;
if( sFolder != "" ) {
  fso = new ActiveXObject("Scripting.FileSystemObject");
  f = fso.GetFolder(sFolder);
  fc = new Enumerator(f.files);
  sItem = "";
  for (; !fc.atEnd(); fc.moveNext()) {
    if( fc.item().name == document.Name ) {
      try {
        editor.OpenFile( sPath );
      }
      catch(e) {
      }
      break;
    }
    else {
      n = fc.item().name.lastIndexOf(".");
      if( n != -1 && fc.item().name.slice( n ) == ".txt" )
        sPath = sFolder + "\\" + fc.item().name;
    }	   
  }
}
Flat Previous Topic | Next Topic


Subject Poster Date
   open next file in the folder user 7/10/2010 4:43 pm
     Re: open next file in the folder Yutaka 7/12/2010 9:08 am
       Re: open next file in the folder user 7/12/2010 5:38 pm
         Re: open next file in the folder Yutaka 7/13/2010 10:04 am
           Re: open next file in the folder user 7/13/2010 10:31 am
             Re: open next file in the folder Yutaka 7/13/2010 11:55 am
               Re: open next file in the folder user 7/13/2010 12:07 pm
                 Re: open next file in the folder Yutaka 7/13/2010 2:09 pm
                 » Re: open next file in the folder tonne 7/14/2010 12:38 pm
                     Re: open next file in the folder user 7/14/2010 1:39 pm

Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文