JScript (WSH) version:

// OpenSciTESession.js

// Run SciTE with the loadsession option, with path correctly quoted
if (WScript.Arguments.count() == 1)
{
        var path = WScript.Arguments.Item(0);
        path = path.replace(/\\/g, '\\\\');

        var shell = WScript.CreateObject("WScript.Shell");
        var sysEnv = shell.Environment("SYSTEM");
        var sciteHome = sysEnv("SciTE_HOME");
        shell.Exec(sciteHome + "\\SciTE.exe \"-loadsession:" + path + "\"");
}


# SciTEses.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.ses]
@="SciTESessionFile"

[HKEY_CLASSES_ROOT\SciTESessionFile]
; English
@="SciTE Session File"
; French
@="Session SciTE"

[HKEY_CLASSES_ROOT\SciTESessionFile\DefaultIcon]
@="C:\\Program Files\\UText\\SciTE\\SciTE.exe"

[HKEY_CLASSES_ROOT\SciTESessionFile\shell\open\command]
; The following doesn't work because backslashes in path must be escaped
#~ @="\"C:\\Program Files\\UText\\SciTE\\SciTE.exe\" \"-loadsession:%L\""
@="CScript.exe \"C:\\Program Files\\UText\\SciTE\\OpenSciTESession.js\" \"%L\""


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to