Hi, I wrote a script in the Resume event of a folder. The first few lines look like this:

Hi, I wrote a script in the Resume event of a folder. The first few lines look like this:

var item = LL.getEvent().getItem();

alert(“item=”+item);

This shows “item=null” in the resulting alert.

I expected that in line 2, item would contain a reference to the folder on which the resume event was triggered, but it looks like I’m missing something here. I want to darken the folder item on my desktop when the folder is opened, and lighten it back to the original color when it is closed. What would be the right way to achieve this effect?

Thanks in advance!

]]>

5 Commentsto Hi, I wrote a script in the Resume event of a folder. The first few lines look like this:

  1. Anonymous says:

    < ![CDATA[

    Var item = LL.getEvent().getContainer().getOpener();

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thanks Lukas Morawietz , but this gives me the same result.



    var item = LL.getEvent().getContainer().getOpener();


    alert(“item=”+item);



    This snippet shows “item=null”.



    Btw I’ve installed this script by performing the following steps:


    * Long press on the folder item on my desktop,


    * Select Folder settings,


    * Select Events & actions,


    * Select Resumed and enter the script.



    I’m using LLX V10.1B1 (R1724)

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Oh yes, this “bug” was mentioned by TrianguloY.



    I think it will be fixed soon, but for the moment use:



    LL.getEvent().getContainer().getItemByLabel(folders-label);



    Where folders-label is your folders label.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    OK thanks!

    ]]>

  5. Anonymous says:

    < ![CDATA[

    getItem is only used for item related events, whereas pause/resume are only linked with a container. I will add an exception in the next release to set the result of getContainer() so that it returns the paused/resumed container, not the “focused” one.


    There could be zero, one or more items opening a container, and as a consequence getItem() is not suitable to hold this data. getOpener() is indeed the method to use to query this item, although it will only return the first item opening it (which is right 99,999% of the cases).

    ]]>

Leave a Reply

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