Sorry, forgot the script. 

if (WScript.Arguments.count() == 1)
{
    var path = WScript.Arguments.Item(0);
    var shell = WScript.CreateObject("WScript.Shell");
    var sysEnv = shell.Environment("SYSTEM")

    var sciteHome = sysEnv("SciTE_HOME");
    shell.Exec("\"" + sciteHome + "\\SciTE.exe\" \"-loadsession:" + path.replace(/\\/g, '\\\\') + "\"");
}
 
 
-----Original Message-----
Date: Tue, 12 Sep 2006 10:39:29 +0200
From: Philippe Lhoste <[EMAIL PROTECTED]>
Subject: [scite] Re: Loading Sessions From Commandline
To: [email protected] Message-ID: <ee5rnn$3mc$[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

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 -- -- -- -- -- -- -- -- -- -- -- -- -- --



Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to