I need help, I have no programming skills at all, but I am enjoying the power that LLx brings to my phone.

I need help, I have no programming skills at all, but I am enjoying the power that LLx brings to my phone.

I’ve spent the last few days trying but I cant do it, so I would be grateful if one of you geniuses could write a script that would:

One the first click:

Would scroll a panel on the desktop up, either by a specific amount or to a scroll stop and then open a folder.

Then on the second click would do the inverse, ie. close the folder then scroll the panel back down to its starting point.

The thing is I dont want to scroll the panel manually so I want to disable scrolling within the panel, is this possible.

Thanks in advance for any help given.

]]>

12 Commentsto I need help, I have no programming skills at all, but I am enjoying the power that LLx brings to my phone.

  1. Anonymous says:

    < ![CDATA[

    I do not understand what you want, sorry.


    Do you want to move a panel or scroll inside or scroll the desktop?


    What folder? Does it have a name or other defining characteristics or any folder will do?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Just a question: the starting position of the panel is the default one? ( 0, 0 )

    ]]>

  3. Anonymous says:

    < ![CDATA[

    That is probably the case, in which case this position can be detected to either do an action or the other, I guess this is what TrianguloY have in mind 😉

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Exactly. I can’t do it now (I’m far away from my tablet) but I know exactly what to do. Of course if someone want to do it before, better.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Remember to never compare floats with ==

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Except if the value is 0 or Nan 😉



    Ok, here is what I think TrianguloY would have suggested (more or less, unchecked):



    var panel_id = your_panel_id_here;


    var folder_name = “_your_folder_label_here_”;



    var desktop = LL.getCurrentDesktop();


    var folder = desktop.getItemByName(folder_name);


    var panel = desktop.getItemById(panel_id);



    if(panel.getPositionX()==0 && panel.getPositionY()==0) {


      panel.setPosition(some_position_x, some_position_y);


      folder.open();


    } else {


      panel.setPosition(0, 0);


      folder.close();


    }


     

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Yes, but my idea was a bit different: a script that will output the wanted script, with the folder id, the panel, and the position.


    So you just need to run my script from the folder with the panel at the desired location and…voila. A full ready-to-use script. (That you need to copy/paste, of course)

    ]]>

  8. Anonymous says:

    < ![CDATA[

    I fear that all our posts may confuse Frank Brown a bit…

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Frank Brown: your folder is inside the panel, or outside?

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Hi guys thanks for the quick responses. I get confused when writing code or scripts but when I read them, for example Pierre Hébert’s code above I understand it and realise how simple it is.


    TrianguloY the folder I want to open would ideally be on the desktop but hidden from view (possibly on another desktop) and the script would be run from an onTap module in a Zooper widget.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Here you have:


    This script at the bottom will show the final script you should use(Pierre’s script with some minor changes and all the Ids and position):



    Instructions:


    Copy paste this script into a new one, check the ‘show in iten menu’


    Put the folder into the container (You will be able to move folder after)


    Scroll the panel to the wanted position (when the folder will open, not the 0,0 )


    Launch this script from the folder (long click, scripts)


    Copy paste the output script and replace the previous one (or not) This script is the one you will need.


    You can now move the folder wherever you want. The script will use container’s IDs , so theoretically you won’t have problems, if so tell us.



    ——————-



    var event = LL.getEvent();


    var panel = event.getContainer();


    var folder = event.getItem().getContainer();



    var string = “var panel_id = ” + panel.getId() + “;\n\


    var folder_id = ” + folder.getId() + “;\n\


    \n\


    var panel = LL.getContainerById(panel_id);\n\


    var folder = LL.getContainerById(folder_id).getOpener();\n\


    \n\


    \n\


    if(panel.getPositionX()==0 && panel.getPositionY()==0) {\n\


      panel.setPosition(“+panel.getPositionX() + “,” + panel.getPositionY() + “);\n\


      folder.open();\n\


    } else {\n\


      panel.setPosition(0, 0);\n\


      folder.close();\n\


    }”;


     


    prompt(“copy.paste” , string );

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Thankyou TrianguloY that script worked perfect. And thank you Pierre Hébert for creating an awesome and powerful launcher.

    ]]>

Leave a Reply

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