kelye | 3 Dec 13:26 2008
Picon

lua script execution on startup


how can i execute a lua script, or a simple anonymous function, on lua
initialization ?

i've tried to add in SciTEUser.properties ext.lua.startup = path to my
script but the script does not run on startup

thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Frank | 3 Dec 13:34 2008
Picon

Re: lua script execution on startup


the configuration should look like this (different property-name):
ext.lua.startup.script=$(SciteDefaultHome)\lua\base.lua

regards Frank

On 3 Dez., 13:26, kelye <bogdan.be... <at> gmail.com> wrote:
> how can i execute a lua script, or a simple anonymous function, on lua
> initialization ?
>
> i've tried to add in SciTEUser.properties ext.lua.startup = path to my
> script but the script does not run on startup
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

kelye | 3 Dec 14:52 2008
Picon

Re: lua script execution on startup


Thanks!
It works but not with the expected results :)

i did a small script that reads each line in SciTE.session and opens
each path it finds.

but that script is runned at each new file load and slows Scite :(

i made it a function and added a shortcut.. so each time i forget to
load the session i'm calling my function to load the session:)

On Dec 3, 2:34 pm, Frank <frank.wunderl... <at> gmail.com> wrote:
> the configuration should look like this (different property-name):
> ext.lua.startup.script=$(SciteDefaultHome)\lua\base.lua
>
> regards Frank
>
> On 3 Dez., 13:26, kelye <bogdan.be... <at> gmail.com> wrote:
>
> > how can i execute a lua script, or a simple anonymous function, on lua
> > initialization ?
>
> > i've tried to add in SciTEUser.properties ext.lua.startup = path to my
> > script but the script does not run on startup
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
(Continue reading)

Frank | 3 Dec 15:14 2008
Picon

Re: lua script execution on startup


without see the code of your script i cannot help you much...why don't
you use the save.session-property? it saves the seesion on exit and
restore it on startup.

a simple script from our gui-extension (maybe perform works only with
sciteRu):

local function OpenFile(filename)
	if filename:match(".session$") ~= nil then
		filename = filename:gsub('\\','\\\\')
		scite.Perform ("loadsession:"..filename)
	else
		scite.Open(filename)
	end
end

maybe this helps you.a session file can hold not only the filenames.
it can contain line position, active buffer and recent-files.so it can
be difficult to parse it manually.

regards frank

On 3 Dez., 14:52, kelye <bogdan.be... <at> gmail.com> wrote:
> Thanks!
> It works but not with the expected results :)
>
> i did a small script that reads each line in SciTE.session and opens
> each path it finds.
>
(Continue reading)

kelye | 3 Dec 15:43 2008
Picon

Load last session


This is a very simple and noob style way to reload your session if you
are opening a file by doubleclick

First create a lua script (loadsession.lua in my example) and put it
in your Scite directory (i've created another subdirectory called
'user')

In that file put the next function

function load_session()
    for line in io.lines(props['SciteUserHome']..'\\SciTE.session')
do
        for file in string.gmatch(line,'buffer.%d.path=(.*)') do
            scite.Open(file)
        end
    end
end

In your SciTEUser.properties file or SciTEGlobal.properties
add these lines

ext.lua.startup.script=$(SciteDefaultHome)/user/loadsession.lua

command.name.1.*=Load Session
command.1.*=load_session
command.subsystem.1.*=3

Now, if you open a single file by doubleclick you can press CTRL+1 and
get your session tabs back.
(Continue reading)

kelye | 3 Dec 15:53 2008
Picon

Re: lua script execution on startup


Thanks for your time Frank!
I am using save.session and also check.if.already.open=1 so i'm having
only one instance .
The problem is when i double click a file that has Scite as default
editor and i'm not having Scite running. It opens Scite with that file
only without loading the session.
Untill now i had to open the .properties file, make
check.if.already.open 0 and open another instance of Scite (that one
will load the session), put it back to 1,close the instance with the
single file, open the file in the instance with the session... (the
action itself takes less than writing or reading it ... but still )

I've started another topic with my solution :)

On Dec 3, 4:14 pm, Frank <frank.wunderl... <at> gmail.com> wrote:
> without see the code of your script i cannot help you much...why don't
> you use the save.session-property? it saves the seesion on exit and
> restore it on startup.
>
> a simple script from our gui-extension (maybe perform works only with
> sciteRu):
>
> local function OpenFile(filename)
>         if filename:match(".session$") ~= nil then
>                 filename = filename:gsub('\\','\\\\')
>                 scite.Perform ("loadsession:"..filename)
>         else
>                 scite.Open(filename)
>         end
(Continue reading)

René Treviño Hernández | 3 Dec 15:26 2008
Picon

Re: lua script execution on startup

Hi Frank, where I put this function in SciTE?
Thanks.
Regards.

De: Frank <frank.wunderlich <at> gmail.com>
Para: scite-interest <scite-interest <at> googlegroups.com>
Enviado: miércoles, 3 de diciembre, 2008 8:14:01
Asunto: [scite] Re: lua script execution on startup


without see the code of your script i cannot help you much...why don't
you use the save.session-property? it saves the seesion on exit and
restore it on startup.

a simple script from our gui-extension (maybe perform works only with
sciteRu):

local function OpenFile(filename)
    if filename:match(".session$") ~= nil then
        filename = filename:gsub('\\','\\\\')
        scite.Perform ("loadsession:"..filename)
    else
        scite.Open(filename)
    end
end

maybe this helps you.a session file can hold not only the filenames.
it can contain line position, active buffer and recent-files.so it can
be difficult to parse it manually.

regards frank


On 3 Dez., 14:52, kelye <bogdan.be... <at> gmail.com> wrote:
> Thanks!
> It works but not with the expected results :)
>
> i did a small script that reads each line in SciTE.session and opens
> each path it finds.
>
> but that script is runned at each new file load and slows Scite :(
>
> i made it a function and added a shortcut.. so each time i forget to
> load the session i'm calling my function to load the session:)
>


¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy:
http://mx.mujer.yahoo.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Frank | 3 Dec 21:21 2008
Picon

Re: lua script execution on startup


you can it put in anywhere in a lua-script wich is loaded at startup
and use it from another function or a dostring in a command property.
its only a help-function, not intended to be a full script.as i wrote
above its a part of SciteRu's Sidebar.lua. look at the sciteRu -
project (http://scite-ru.googlecode.com) for more.

regards Frank

On 3 Dez., 15:26, René Treviño Hernández <renetr... <at> yahoo.com.mx>
wrote:
> Hi Frank, where I put this function in SciTE?
> Thanks.
> Regards.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

kelye | 4 Dec 09:43 2008
Picon

Re: lua script execution on startup


The default Scite release does not have Perform as e metod of 'scite'
so that will work only in Scite-ru.

On Dec 3, 10:21 pm, Frank <frank.wunderl... <at> gmail.com> wrote:
> you can it put in anywhere in a lua-script wich is loaded at startup
> and use it from another function or a dostring in a command property.
> its only a help-function, not intended to be a full script.as i wrote
> above its a part of SciteRu's Sidebar.lua. look at the sciteRu -
> project (http://scite-ru.googlecode.com) for more.
>
> regards Frank
>
> On 3 Dez., 15:26, René Treviño Hernández <renetr... <at> yahoo.com.mx>
> wrote:
>
> > Hi Frank, where I put this function in SciTE?
> > Thanks.
> > Regards.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Frank | 4 Dec 10:48 2008
Picon

Re: lua script execution on startup


i've found an older thread of me regarding sesion-files:
http://groups.google.com/group/scite-interest/browse_thread/thread/5b9b2d5afe145b03
take a look on mozers posting from november 19th.

i'm using sciteru, because it has many useful extensions (http://scite-
ru.googlecode.com/svn/trunk/pack/doc/SciTE-Ru_Kernel.html). maybe its
also a choice for you. you'll find my version (german language) at
http://www.fw-web.de/scite.php.

frank

On 4 Dez., 09:43, kelye <bogdan.be... <at> gmail.com> wrote:
> The default Scite release does not have Perform as e metod of 'scite'
> so that will work only in Scite-ru.
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane