Comment on page
Script
VBScript/JScript are the built-in script engines of EverEdit. You could use VBS/JScript to manage your macros and define syntax highlights. Recommend JScript to write scripts for EverEdit. JScript is very simple and powerful, you could leverage various COM components in JScript/VBScript.
In order to manage scripts, all the files should be placed into
macro
folder. EverEdit will automatically build a menu for these scripts. After adding/deleting scripts, you'd better refresh the menu by clicking [Reload Macros...] from Addons menu.VBScript files should be saved with
.mac
or .evb
and JScript should be .ejs
.Open shortcut manager and drag-drop a script file into the dialog or click
Bind
button to add a script file into Shortcut View. Then, just set the shortcut like normal commands.SCRIPT_PATH
: get path of current scriptSCRIPT_FULLNAME
get full path(path+filename) of current scriptSCRIPT_NAMEONLY
get file name only of current scriptInclude()
: include a script
An application object means the EverEdit instance you are using.
// functions
Menu CreateMenu();
void Sleep(DWORD dwMillisec);
void SendCommand(int nCmd);
void SendCommandEx(string strCommand);
void WebPreview(string strPathName);
Document NewDoc();
Document OpenDoc(string strPathName);
void OutputText(string strText, bool bClear=false, bool bTerminate=false);
string ShowInputBox(string strPrompt, string strTitle);
int ShowMsgBox(string strText, string strTitle, int buttons);
int ShowHtmlHelp(string strPathName, string strWord);
string CreateTempFile(bool bAutoDelete);
void DebugLibrary(string strPathName);
void OpenSnippetByTitle(string title);
string GetResultFromExe(string cmdline, string initdir="", int encoding=0)
// delete template file by title
void DeleteTemplate(string title)
// properties
Document ActiveDoc; //get
HexDoc ActiveHex; //get
Document document; //get
OutputWindow OutputWindow; //get
Project Project; //get
string AppPath; //get
string CommandBox; //get
ULONG Hwnd; //get
ULONG FileCount; //get
string Version; //get
string ClipboardText; //get,set
int Lang;//get
// Create a menu that will show at your gloabl cursor position.
Menu CreateMenu();
// Send a command to main window
// nCmd: the ID of a menu item.
void SendCommand(int nCmd);
// Send a string command(cm_edit_find...), get more details by shortcut dialog.
void SendCommandEx(string strText);
// Open a file in a new tab by web view, and the current text document will be linked to this tab.
// You could press Ctrl+B to switch between them.
void WebPreview(string strPathName);
// Output texts into OutputWindow.
// bClear: Clear the exist content?
// bTerminate: Terminate running process?
void OutputText(string strText, bool bClear=false, bool bTerminate=false);
// Popup an input box.
// strPrompt: promopt text
// strTitle: title of the input box.
string ShowInputBox(string strPrompt, string strTitle);
/**
Popup a message box.
strText: message text
strTitle: title of the message box
buttons: buttons and icons.
Ref the below values to set buttons:
#define MB_OK 0x00000000L
#define MB_OKCANCEL 0x00000001L
#define MB_ABORTRETRYIGNORE 0x00000002L
#define MB_YESNOCANCEL 0x00000003L
#define MB_YESNO 0x00000004L
#define MB_RETRYCANCEL 0x00000005L
#define MB_CANCELTRYCONTINUE 0x00000006L
#define MB_ICONHAND 0x00000010L
#define MB_ICONQUESTION 0x00000020L
#define MB_ICONEXCLAMATION 0x00000030L
#define MB_ICONASTERISK 0x00000040L
**/
int ShowMsgBox(string strText, string strTitle, int buttons);
// Open a .chm or .hlp file, find and locate strWord.
// strWord: If strWord is empty, start page will be displayed.
int ShowHtmlHelp(string strPathName, string strWord);
// Create a temporary file.
// bAutoDelete: delete this file after closing EverEdit?
string CreateTempFile(bool bAutoDelete);
// This function is used for debugging a plugin developed by C/C++.
// You could attach process of EverEdit first before invoking this function.,
void DebugLibrary(string strPathName);
// Show save/open dialog.
// bOpen:true:open dialog, false:save dialog
// strDefaultDir:default folder path
// strExts:default exts, format:*.png;*jpg;*.bmp
string ShowFileDialog(bool bOpen, string strDefaultDir, string strExts);
An document metans the active text tab.
// functions
Menu CreateMenu();
void SendCommand(int nCmd);
void Refresh();
bool HasSel();
void ClearSel();
void InsertAt(int line, int col, string strText);
void Insert(string strText);
void MoveCaret(int nLength);
void IndentInsert(string strText);
void Delete(int sline, int scol, int eline, int ecol);
void Delete(Pos spos, Pos epos);
void Delete();
void SetCaretPos(int line, int col, bool bVisible);
void SetSel(int sline, int scol, int eline, int ecol);
void SetSel(Pos pos1, Pos pos2);
int AddSel(Pos pos1, Pos pos2);
Pos Offset2Pos(int nOffset);
int Pos2Offset(Pos pos);
int ReplaceAll(string strFind, string strReplace, bool bCase=true, bool bRegex=false, bool bWord=false);
int FindAll(string strFind, bool bCase=true, bool bRegex=false, bool bWord=false);
bool FindNext(string strFind, bool bCase=true, bool bRegex=false, bool bWord=false);
string GetWord(int flag);
string GetLineText(int nLine);
int GetLineLength(int nLine);
int GetWrapCount(int nLine);
int InsertSnippet(string strSnippet);
void CommentLine(string strCommentLine, bool bComment);
void CommentBlock(string strCommentOn, string strCommnetOff, bool bComment);
void write(string strText);
void writeln(string strText);
void close();
bool ExportTo(string strPathName, int nEncoding=/*same as document*/, bool bBom=/*same as document*/, int nEol=/*same as document*/)
void GhostTyping(string text, int speed=100);
/**
type:
0: cancel wrap
1: wrap at window's edge
2: smart wrap
3: wrap by column
4: wrap by column (extend tabs)
5: N/A (reserved)
6: wrap by pixel
**/
void Wrap(int type, int value=0);
// properties
Pos SelStartPos;
Pos SelEndPos;
bool Dirty;
int CaretLine;
int CaretCol;
int LineCount;
string PathName;
string Scope;
string EndOfLine;
void GroupUndo;//set
Pos CaretPos;//get,set
string SelText;//get,set
int Encoding;//get,set
int TabStop;//get,set
bool SoftTab;//get,set
string Text;//get,set
string Syntax;//get,set
int Hwnd;//get
// Create a menu and this menu will follow the caret of the active document.
Menu CreateMenu();void SetSel(int sline, int scol, int eline, int ecol);
void SetSel(Pos pos1, Pos pos2);
Set normal selection.
int AddSel(Pos pos1, Pos pos2);
Add region into selection.
Pos Offset2Pos(int nOffset);
int Pos2Offset(Pos pos);
// Force to redraw current document.
void Refresh();