For people interested in scripting, I have updated the sample script package with a new reference plugin…

For people interested in scripting, I have updated the sample script package with a new reference plugin implementation for use with V14b6 and later.

The package features a sample counter plugin, with an object oriented approach. I believe it should greatly help in writing plugins and code re-use.

http://www.lightninglauncher.com/scripting/samples/SampleLLXScript-2.0.tar.gz

http://www.lightninglauncher.com/scripting/samples/SampleLLXScript-2.0.tar.gz
]]>

8 Commentsto For people interested in scripting, I have updated the sample script package with a new reference plugin…

  1. Anonymous says:

    < ![CDATA[

    Nice exemple !


    What are the available classes in `net.pierrox.lightning_launcher.prefs.*` ?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Is “my” a fixed keyword?

    ]]>

  3. Anonymous says:

    < ![CDATA[

    In fact this is the use of the “getMy()” method. Rhino allows the use of properties when it detects getter and setter.


    Usually I don’t use this feature and prefer to use the explicit method, but this time I found it was way better this way.


    Instead of:


    getActiveScreen().getCurrentDesktop().getId()


    you could write


    activeScreen.currentDesktop.id


    Less verbose, but it can be confusing when mixed with functions and custom properties.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    1/ Is there a way to stop a script execution ?


    Ex: instead of :



    var counter = http://item.my.counter


    if (!counter)


    {


    do_init()


    }



    Do something like :



    var counter = http://item.my.counter


    if (counter)


    stop_the_script_here()


    //else (no need)


    do_init()



    I like to avoid indentations when there are ways to avoid them.. (make sense ?)



    Is it possible ? 

    ]]>

  5. Anonymous says:

    < ![CDATA[

    And also :


    2/ Instead of :



    getEvent().getItem().my.counter.nextValue();



    Can we write :



    event.item.my.counter.nextValue();



    ?

    ]]>

  6. Anonymous says:

    < ![CDATA[

    For 1/ use return



    For 2/ you can do that for all getters except getEvent() which is not a special function:


    getEvent().item.my.counter.nextValue();

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Pierre Hébert 1/ oh yes of course it works, I was thinking about other languages for which it doesn’t work.. My bad, I should stop learning new language ^^

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *