Académique Documents
Professionnel Documents
Culture Documents
Note!
Don’t place any non script files direct into script language subdirectories !
All files e.g. in VBScript subrirectory are consider as script and non script file causes compilation error.
modules library
You can write own library and share function from library in other scripts. Unique module_name is identifier.
To call function from other module, place module name before function name:
myLibrary.someFunction()
global functions/subroutines
echo(text: string)
information box with text and button OK
sleep(ms: integer)
stops script execution for number of miliseconds
setWaitCursor([boolean])
sets screen cursor to HourGlass (true parameter) and Default one (false parameter)
inputText(label [, default_value [, cancel_value]]: string): string
input text dialog. Cancel_value is returned after press Cancel button.
setClipboardText(text: string)
stores text into clipboard
getClipboardText(): string
returns text from clipboad
runPSPadAction(ActionName: string)
allows to run any PSPad editor action. List of actions follows.
getVariable(name: string)
returns value of variable passed as parameter. You can use PSPad or system variable as well.
reloadClips
reloads all code clip files
logClear
clears whole LOG window content
logAddLine(test: string)
adds new line into LOG
logGetLine(index: integer): string
returns line from LOG, identified by index parameter (numbered from 0)
logSetLine(index: integer, test: string)
sets log line, identified by index
logLinesCount(): Integer
returns current number of LOG window lines
logLineIndex([index: integer]): Integer
sets or returns (if no parameter) current line index of LOG window
logSetTypeMemo
sets LOG window type to memo style - you are able to make free selection, byt without error marks
logSetTypeList
sets LOG window type to list style - only line by line selection, but with error marks
logSetParser(expression: string): string
sets LOG parser expression
pspadVersion(): string
returns PSPad version
moduleExists(name: string):boolean
returns True if script module exists
moduleVersion(name: string):string
returns version of module, if module doesn't exists, returns empty string
moduleFileName(name: string):string
returns file name of module, if module doesn't exists, returns empty string.
modulePath():string
returns module file path include last backslash
projectFilesCount: integer
returns number of files (not folders) in project. Use cycle from 0 to projectFilesCount-1
projectFiles(index: integer): string
returns file name for index. If file doesn't exists, returns empty string
projectItemsCount: integer
returns number of all items (files and folders) in project. Use cycle from 0 to projectItemsCount-1
projectItems(index: integer): string
returns item name for index. If item doesn't exists, returns empty string
projectItemType(index: integer): integer
returns project item type. 1: folder, 2: file, -1: item doesn't exists
projectFileName: string
returns project file name
projectSave
saves project
newEditor(): object
creates new object for editor handling
sample vb script
' it will create new editor window, copy all text from first window
into new
' and save new file as C:\SAMPLE.TXT
const module_name = "sample" 'this name must be unique !!!
const module_desc = "Sample script" 'script description
const module_ver = "0.001a" 'version
sub Demo1
msgbox "You run Demo1 from sample script"
end sub
sub Demo2
msgbox "You run Demo2 from sample script"
end sub
sub Procedure
set obj = NewEditor()
for i = 0 to editorsCount - 1
obj.assignEditorByIndex(i)
obj.activate
if i = 0 then 'for first file we call user convertor selector
runPSPadAction "aUserConvertors"
else 'for all other files we run last used convertor
runPSPadAction "aLastUserConvertor"
end if
next
end sub