[EMAIL PROTECTED] a écrit :
I was wondering if anyone has had any luck luck launching sessions directly from the command-line (I'm running WinXP). I've already configured my instance of SciTE to reload the last session I was working on, but I'd like to see if I could get a little more control over my sessions.

See, I create a new session file on my desktop for each part of a project that I'm working on, and ideally I'd like to be able to just double-click on a session file to have SciTE open the actual session, not just the contents of the session file. I figured the best option was to change the way SES files were handled, but I looked over the command-line options and didn't see anything too promising. Still, I thought I would check with the other users to see if anyone has pulled this off and could point me in the right direction.

Yes. It seems you have to have a third party script that handle .ses files. Some people made it in Python or Perl, I made mine in AutoHotkey, perhaps one could use WSH. I will see if I can do one in VBScript or JavaScript.

Here is my AutoHotkey script, to show the idea:

; Run SciTE with the loadsession option, with path correctly quoted
StringReplace path, 1, \, \\, All
Run %SciTE_Home%\SciTE.exe "-loadsession:%path%"

The problem is that, IIRC, backslashes as parameters to SciTE are handled to expand, so you have access to \r \n \t... So you must double all backslashes in the path (thanks Microsoft (or CP/M?) for this stupid choice of path separators...).

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\""
@="\"C:\Program Files\USys\AutoHotkey\AutoHotkey.exe\" "C:\\Program Files\\UText\\SciTE\\OpenSciTESession.ahk\" \"%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