Stupid example:
1. Open menu "Options" -> "Open Lua Startup Script"
2. Write any Lua code, e.g. print('Selected: <'..editor:GetSelText()..'>')
3. Press Ctrl-S
(as if you want to save this file), your script will be immediately executed, output will appear in the output pane (on the right).
4. Repeat steps 2-3
Less stupid example:
Insert this into
SciTEGlobal.properties
ext.lua.startup.script=$(SciteDefaultHome)/your_script.lua
#print length of selected text
command.33.*=PrintSelectionLength
command.subsystem.33.*=3
command.mode.33.*=savebefore:no
command.shortcut.33.*=F1
# User defined key commands
user.shortcuts=\
F1|1133|\
Ctrl+Shift+V|IDM_PASTEANDDOWN|\
Ctrl+PageUp|IDM_PREVFILE|\
Ctrl+PageDown|IDM_NEXTFILE|
user.context.menu=\
Selection Length (F1)|1133|\
||\
Toggle Output|IDM_TOGGLEOUTPUT|
Insert this in your_script.lua
function PrintSelectionLength()
local sel = editor:GetSelText()
print(#sel..' chars selected')
print(table.concat({sel:byte(1,-1)},','))
end
Now you can press F1
to see ASCII codes of symbols under selection while editing any file in SciTE.