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

Threaded | Oldest First Previous Topic | Next Topic | Bottom
Poster Thread
user
Posted on: 7/14/2010 1:39 pm
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: open next file in the folder
that is very useful thanks
but why it appears not well formatted? can you format it as the previous script?
thanks
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;
    }	   
  }
}
Yutaka
Posted on: 7/13/2010 2:09 pm
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2404
Re: open next file in the folder
No, it doesn't work with previous text file.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

user
Posted on: 7/13/2010 12:07 pm
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: open next file in the folder

does this work for the 'previous' txt file as well?
thanks
Yutaka
Posted on: 7/13/2010 11:55 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2404
Re: open next file in the folder
You can assign any shortcut key from the configuration properties > Keyboard tab. You can select this macro in the My Macros category, and then assign a new key.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

user
Posted on: 7/13/2010 10:31 am
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: open next file in the folder
thanks and what are the hotkeys to view the next/previous txt file?
Yutaka
Posted on: 7/13/2010 10:04 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2404
Re: open next file in the folder
This is an example of the macro that opens the next .txt file in the same folder as the opened file.


// This macro opens the next ".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 ) {
           for( fc.moveNext(); !fc.atEnd(); fc.moveNext()) {
               n = fc.item().name.lastIndexOf(".");
               if( n != -1 ){
                   if( fc.item().name.slice( n ) == ".txt" ){
                       sPath = sFolder + "\\" + fc.item().name;
                       try {
                            editor.OpenFile( sPath );
                       }
                       catch(e){
                       }
                       break;
                   }
               }
           }
           break;
       }
    }
}


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

user
Posted on: 7/12/2010 5:38 pm
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: open next file in the folder
can you tell me please how that macro should be
thanks
Yutaka
Posted on: 7/12/2010 9:08 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2404
Re: open next file in the folder
Hi user,

You could write a macro to view the next text file in the current folder by pressing a shortcut key.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

user
Posted on: 7/10/2010 4:43 pm
Home away from home
Joined: 9/29/2006
From:
Posts: 212
open next file in the folder
hello

when you open an image file with Windows XP Image Viewer, and you click ENTER, it opens the next (in alphabetical order) image file that exists in the current folder

can Emeditor do the same with txt files ?

to open the next file in the current folder using a key shortcut (maybe not ENTER, but some else)?

thanks
Threaded | Oldest First Previous Topic | Next Topic | Top


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