Hi folks, If it’s possible to do this with a script can someone point me in the right direction please, I’ve looked…

Hi folks, If it’s possible to do this with a script can someone point me in the right direction please, I’ve looked at other scripts and docs but I couldn’t find anything obvious.

I have a shortcut thats pinned and a list of non pinned shortcuts underneath that scroll under it. When I tap a non pinned shortcut i want its position (move forwards/backwards) to change so its above the pinned shortcut (it will be moved to where the pinned shortcut is,and then revert it back again afterwards)

Hope that makes sense. Thanks.

]]>
(Next Post) »

6 Commentsto Hi folks, If it’s possible to do this with a script can someone point me in the right direction please, I’ve looked…

  1. Anonymous says:

    < ![CDATA[

    You’ll have to change the z-order of that item.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Launch script on tap action to change y-position up and down, then if necessary execute it’s intent.



    (If “underneath” means y not z)

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Lukas Morawietz That’s what I want to do thanks! I don’t want to be spoon fed but any further tips would be greatly appreciated as google isn’t helping me much at the moment.



    Lutz Linke I am doing that as part of the process but underneath being  z is the part I was stuck on.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    public void setItemZIndex (int itemId, int index)



    Move an item to another layer. This method will do nothing if the item cannot be found in this container.


    Parameters


    itemId item identifier as returned by getId()


    index new index, starting at 0



    So I need to do this but I don’t know how 🙁 



    I’ve just started using codecademy.com to learn are there any other sites recommended? Thanks

    ]]>

  5. Anonymous says:

    < ![CDATA[

    First you need to identify your items: you can either use their label if they are shortcuts, or you can also set an invisible name in the Customize/more/+ tab.


    In addition to this name (and/or label), all items have an internal unique id. This is this id which is needed for setItemZIndex.


    Items are gathered in a container (a desktop, a panel or a folder). Usually you can retrieve the “active” one using LL.getCurrentDesktop().


    You can retrieve an item in a container using getItemByName.



    Putting all this stuff together:


    var container = LL.getCurrentDesktop();


    var unpinned_item = container.getItemByName(‘your_item_name_or_label’);


    container.setItemZIndex(unpinned_item.getId(), your_new_z_index_value);

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Thanks Pierre Hébert​ your explanation helps me understand the code! (a bit) I’ll give it a try when I’ve sobered up

    ]]>

Leave a Reply

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