Find items script

Find items script

This script will go through all the items in the container were it was launched. It will show basic info about it, and the item will be in the topleft corner. ( then a zoom out will shows you where it is)

Also, the script automatically make the items with Alpha 255, the frontmost and will unpin it. To keep these modifications (in case the item was lost somewere) stop the script from the popup. If not, the original settings will go back.

(to sum up: in the “continue?” popup, Yes->no changes; No->changes and stop)

Any suggestions about more info to show, or changes to make are welcomed. Feel free to comment.

Instructions: Just copy\paste and run.

—————————————

var desk=LL.getEvent().getContainer();

var px = desk.getPositionX();

var py = desk.getPositionY();

var ps = desk.getPositionScale();

var items=desk.getItems();

for(var i=items.getLength()-1;i>=0;–i){

    var item = items.getAt(i);

    

    var data = [];

    data[0] = item.getProperties().getInteger(“i.alpha”);

    data[1] = item.getProperties().getString(“i.pinMode”);

    data[2] = desk.getItemZIndex( item.getId() );

    

    desk.setItemZIndex(item.getId() ,  100000);

    item.getProperties().edit().

             setInteger( “i.alpha” , 255).

             setString(“i.pinMode”,”NONE”).

             commit();

    var zoom = Math.min( desk.getWidth() / item.getScaleX() / item.getWidth(), desk.getHeight() / item.getScaleY() / item.getHeight());

    

    desk.setPosition( item.getPositionX() , item.getPositionY() , zoom,true );

    var type = item.getType();

    var info = “Item found:”;

    info+=”\n-Type: “+ type;

        if(type==”Shortcut” || type==”Folder”) info+=”\n-Label: “+item.getLabel();

    info+=”\n-Id: “+item.getId();

    info+=”\n-Pin Mode: “+data[1];

    info+=”\n-Alpha: “+data[0];

    info+=”\n-Tag: “+item.getTag();

    info+=”\n-Visibility: “+item.isVisible();

    info+=”\n-Z Index: “+data[2];

    alert(info);

    

    var n = 3;//zoom out

    desk.setPosition( item.getPositionX()-desk.getWidth()/zoom*(n-1)/2,item.getPositionY()-desk.getHeight()/zoom*(n-1)/2,zoom/n,true );

    

    if(  !confirm(“Continue? (If not, Zindex,alpha and PinMode won’t get back)”)  )return;

     desk.setItemZIndex(item.getId() , data[2]);

     item.getProperties().edit().

              setInteger( “i.alpha” , data[0]).

               setString(“i.pinMode”, data[1]).

     commit();

    

}

desk.setPosition(px,py,ps,true);

Android.makeNewToast(“no more items found”,false).show();

]]>

13 Commentsto Find items script

  1. Anonymous says:

    < ![CDATA[

    I’ll install and test it later when i have some free time. I’ll give you my opinion. Thanks TrianguloY

    ]]>

  2. Anonymous says:

    < ![CDATA[

    It’s working (i did a very quick test)

    ]]>

  3. Anonymous says:

    < ![CDATA[

    I know it work. This is one of my personal scripts that I used (don’t worry, I was planning to post it sooner or later, to be exactly with the new release….quick Google play, quick)


    The question is: is it useful and accurate?  I’m sure it can be improved ;)

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Thank you, I haven’t tried it yet but this sounds like an incredibly useful script. One that I’ve been planning to write, but now you’ve saved me the effort. 😉 Something like this would also be a very useful tool for people trying to get a better understanding of how JavaScript and Android work. 

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Haven’t tested it yet, but sounds great. One idea: instead of unpinning etc it would be helpful to open the long-tap menu for the specific item. This would allow changes with leaving the item intact otherwise.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    … or even stimulating a tap on it? Thinking of ZWs in the background, normally not directly tap-able.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    It’s useful but do you think it would be possible to open the item properties screen for the current item ?

    ]]>

  8. Anonymous says:

    < ![CDATA[

    I had not seen Lutz comments, we share the same idea.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Thank you all. But unfortunately it’s not possible with the current API.


    Pierre Hébert: will it be possible?



    Note: the script unpin the item because if not, you can’t go to their position. This way, also, if you stop you have it there (to go back just pin it) remember that continuing automatically let the item as it was (pinned, alpha and zposition )

    ]]>

  10. Anonymous says:

    < ![CDATA[

    In fact i would like to have a menu item to display the list of all LL items and for each a link to open the properties and another to remove it.


    Better if it was displayed in a hiérarchical way : containers > items or other containers.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    In fact, I see with my LLX screens but also with other LLX users screens that our desktops are more and more complex with several levels of containers, large number of items, some items above other items, some items hidden … So it becomes uneasy to manage our desktops. ANd moreover sometimes we do mistakes and we have an item that is lost but we don’t find it.


    That’s is why I think it would be very useful to have a screen to see all our objects in a hierarchical way with useful information (id, type, name, position, z-order, …) and with actions to do (remove, open LL item menu, go to the container at the position of the item …).

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Displaying the item menu through script could certainly be done, but I agree that a menu to list all items in a hierarchical view is becoming a necessity, not an option, and probably it renders the “display menu by script” less useful.

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Eric Le Bourvellec, Pierre Hébert I agree with you: I would love to have some sort of hierarchical data structure that would allow one to drill down from the topmost levels to the most detailed level for any container. A simple list with + signs that could be clicked to expand & collapse the detail would do the trick nicely.

    ]]>

Leave a Reply

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