open session with lua-script

50 views
Skip to first unread message

Frank

unread,
Nov 17, 2008, 10:05:14 PM11/17/08
to scite-interest
is there a way to do load a session file with lua?
i've looked in ScintillaSciteDoc and SciteLua, but found nothing
related to this...only the normal scite.Open()

regards Frank

Frank

unread,
Nov 18, 2008, 12:59:52 PM11/18/08
to scite-interest
omg, i've tried Scite.Open and unexpectly it handles the session-file
instead of simply open it :)
can i catch (OnSendEditor or similar) a message when a session is
saved (not Scites default session)?

regards Frank

KHMan

unread,
Nov 18, 2008, 9:14:05 PM11/18/08
to scite-i...@googlegroups.com

Whoa... if this is standard behaviour, I think it should be
documented in the HTML... it certainly sounds non-intuitive.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Frank

unread,
Nov 18, 2008, 10:24:36 PM11/18/08
to scite-interest
ok, its seems to be a undocumented feature of SciteRu, the original
scite-version opens the session file like a normal textfile.
i think original scite has no way to open a session by lua-script...
(only for those who do not use SciteRu).

regards Frank

mozers

unread,
Nov 19, 2008, 5:35:16 AM11/19/08
to Frank
Wednesday, November 19, 2008, 6:24:36 AM, Frank wrote:

> omg, i've tried Scite.Open and unexpectly it handles the session-file
> instead of simply open it :)

> ok, its seems to be a undocumented feature of SciteRu,

It - your mistake. The session-file opens as a usual file
(in SciTE-Ru also).
Some way to open a session by lua-script:
-------------------------------------------
local ses_filename = 'C:\\SciTE\\home\\test.session'
ses_filename = ses_filename:gsub('\\','\\\\')

-- Variant 1 (used <http://scite-ru.googlecode.com/svn/trunk/pack/doc/SciTE-Ru_Kernel.html#Perform>)
scite.Perform ("loadsession:"..ses_filename)

-- Variant 2 (used <http://scite-ru.googlecode.com/svn/trunk/pack/LuaLib/shell_rus.html#exec>)
-- shell.exec('C:\\SciTE\\scite.exe -loadsession:'..ses_filename)
-------------------------------------------

> i think original scite has no way to open a session by lua-script...

It is necessary to write a script with cycle on session-file contents and opening of the files listed in him.

--
mozers
<http://code.google.com/p/scite-ru/>

Frank

unread,
Nov 19, 2008, 11:21:04 AM11/19/08
to scite-interest
try open a .session-file with your filemanager (gui-ext) :)
i've closed all tabs and doubleclicked on Scite.session in my Home-
dir...and vóila, the session is loaded and not the session file alone.
for the save-session triggering: as i see you create your own save-
dialog using the hta-file, right?
is it possible to add a Save/load-dialg to shell.dll oder gui-ext? i
have some ideas to use them (e.g. invisible pre-save processing).

regards Frank

mozers

unread,
Nov 20, 2008, 12:37:59 AM11/20/08
to Frank
Wednesday, November 19, 2008, 7:21:04 PM, Frank wrote:

> try open a .session-file with your filemanager (gui-ext) :)
> i've closed all tabs and doubleclicked on Scite.session in my Home-
> dir...and vóila, the session is loaded and not the session file alone.

It was pleasant to you? :)
So work the script (see function OpenFile in SideBar.lua).

> for the save-session triggering: as i see you create your own save-
> dialog using the hta-file, right?

Yes. HTA gives a simple way for creation of any dialogues.

> is it possible to add a Save/load-dialg to shell.dll oder gui-ext?

No. Dialog is absolutely other functionality.

> i have some ideas to use them (e.g. invisible pre-save processing).

For "invisible" dialog is not necessary :)

--
mozers
<http://code.google.com/p/scite-ru/>

Frank

unread,
Nov 20, 2008, 2:36:11 AM11/20/08
to scite-interest
On 20 Nov., 06:37, mozers <moz...@gmail.com> wrote:
> It was pleasant to you? :)
> So work the script (see function OpenFile in SideBar.lua).
*trytohide* sorry, really my mistake...how can i overlooked that.
i added a list to favorites to show some sessions, and tried first
scite.open,
having another bug in it and used code from favourites-list and
thought
already using scite.open.sorry again
this was also the reason to catch savesession
after dialog (adding this to list). but maybe its better to implement
a
separate list for last sessions like scites recent-file-list directly
in files-menu.

> No. Dialog is absolutely other functionality.
SelectDirectory-dialog is also in shell.dll (or gui?) :)
i mean the windows-default-dialogs for opening/savin not owner created
dialogs.

> >  i have some ideas to use them (e.g. invisible pre-save processing).
>
> For "invisible" dialog is not necessary :)

with invisible i mean that the file content is changed without showing
the changes in editor...

regards Frank

mozers

unread,
Nov 20, 2008, 5:32:59 AM11/20/08
to Frank
Thursday, November 20, 2008, 10:36:11 AM, Frank wrote:

> i mean the windows-default-dialogs for opening/savin not owner created
> dialogs.

Use gui.open_dlg.
Probably it is necessary to add gui.save_dlg but work with gui_ext is stopped.
From many wishes only a few is executed.
Steve Donovan and ru-programmers ignore the excellent project :(

--
mozers
<http://code.google.com/p/scite-ru/>

Frank Wunderlich

unread,
Nov 20, 2008, 11:48:15 PM11/20/08
to scite-i...@googlegroups.com
mozers, 20.11.2008 11:32:

>
> Use gui.open_dlg.
> Probably it is necessary to add gui.save_dlg but work with gui_ext is stopped.
> >From many wishes only a few is executed.
> Steve Donovan and ru-programmers ignore the excellent project :(
>
not nice that they are ignoring it....i implemented save_dlg.it's
appended to this mail.

i see that you havnt yet included changes using env-vars in the
favourites list. i thought that these should be ok.
also appended all my changes to actual sidebar.lua (svn).

regards Frank

gui_ext.cpp.diff
sidebar.lua.diff

mozers

unread,
Nov 21, 2008, 3:17:51 AM11/21/08
to Frank Wunderlich
Friday, November 21, 2008, 7:48:15 AM, Frank wrote:

> i implemented save_dlg.it's appended to this mail.

> also appended all my changes to actual sidebar.lua (svn).

Thanks.
Your code will be checked up and added in SVN.

--
mozers
<http://code.google.com/p/scite-ru/>

Reply all
Reply to author
Forward
0 new messages