george fotheringay:
Before discovering this, I tried Lua using your suggestion explicitly. My Lua startup file defines a function OnOpen(filename) to set some bookmarks, and I placed there a test for the name of the last file loaded (in the special case of my application, I know what this is in advance), followed by "scite.MenuCommand(1200)" as the last thing in the function. But this did not work. I thought perhaps SciTE did some further processing on the file before starting to listen for keyboard input, and so reset the focus to the last buffer. But changing the return of OnOpen from false to true made no difference either.
Worked for me on a simple test but may be dependent on what in particular is being done. Its sequencing issues like this that make it difficult to say that -menucommand will work from the command line. Perhaps in other circumstances such as when opening session files or using check.if.already.open -menucommand:1200 doesn't work.
(1) SciTE should have a property named something like "SciTECommandLine", both gettable and settable (if possible), and exposed to Lua via scite.SciTECommandLine. This would enable the Lua startup script to get a first shot at the command line immediately after it's loaded. (Additionally, you could have an event "OnFinishingLoadingLua," but this might not be strictly necessary.)
That is reasonable but is going to make this even more complex. Command line processing is already quite complex as the command line is processed with two phases with an early exit if performing print. The command line is a list of strings, not a single string. Neil _______________________________________________ Scite-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scite-interest
