Lua: error checking global scope for command 'make_uppercase'

16 views
Skip to first unread message

Jim Eggleston

unread,
Mar 3, 2026, 6:29:17 PM (7 days ago) Mar 3
to scite-interest
I have been having trouble getting functions defined in a Lua startup script to be recognised. The error I am getting is in the subject line. I have been doing my best to look for solutions and as far as I can tell, my set up is correct. Here are the details of what i am doing so far. This is just a simple test script. I am hoping to do something more useful once I get this working.

SciTE version 5.6.0
OS: Windows 11

Script: make_uppercase.lua, which is saved in the SciTE directory i.e. $(SciteDefaultHome)

function make_uppercase()
    print("make_uppercase")
    local sel = editor:GetSelText()
    editor:ReplaceSel(string.upper(sel))
end

In the SciTEGlobal.properties I have:
ext.lua.startup.script="$(SciteDefaultHome)/make_uppercase.lua"
ext.lua.directory="$(SciteDefaultHome)"
ext.lua.auto.reload=1

command.name.3.*=Make Selection Uppercase
command.subsystem.3.*=3
command.3.*=make_uppercase
command.mode.3.*=savebefore:no
command.shortcut.3.*=Ctrl+M

When I open another file and press Ctrl+M, i get the message in the subject line. I feel like I am missing something simple but cannot work out what it is.

I would appreciate any help anyone can offer.

scintillaDotOrg

unread,
Mar 3, 2026, 7:59:58 PM (7 days ago) Mar 3
to scite-interest
Jim:
 
Script: make_uppercase.lua, which is saved in the SciTE directory i.e. $(SciteDefaultHome)
... 
ext.lua.startup.script="$(SciteDefaultHome)/make_uppercase.lua"

Lose the quotes. Properties retain quotes.

Neil

Jim Eggleston

unread,
Mar 3, 2026, 9:18:25 PM (7 days ago) Mar 3
to scite-i...@googlegroups.com
Hi Neil,

Thanks but that didn't work. I noticed I had / instead of \ but changing that didn't work either. I restarted SciTE after each change.

I am also trying to use dofile, just to see if I can get it to work, but it is saying:
'dofile' is not recognized as an internal or external command, operable program or batch file.

This is how I am using it in the properties file:

command.go.*.lua=dofile $(FilePath)
command.go.subsystem.lua=3


I should point out that I am using Sc1 version 5.60 with my own global properties file. Is there anything else? Is there another setting I need?

Jim



--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scite-interes...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/scite-interest/071b240c-dc74-4f01-a815-bc1dad8369abn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages