I am having some trouble with some of the scripts I am trying to write and am wondering if someone could help me out…
I am having some trouble with some of the scripts I am trying to write and am wondering if someone could help me out or point me in the write direction. Please understand that not only am I new to lightning launcher but I am kind of new to javascript also.
I am trying to have to have some text when tapped on run a script which opens a folder that is in a panel that is in another panel. I can open a folder that is on the desktop bit once it goes in a layer then I am unsure how to direct the code to look for the folder in that panel. I was thinking that it was something like ….
Var f1 = get.containerById(“name of panel”).getItemByName(“folder”);
f1.open();
but that doesn’t work keeps saying that cannot open from null.
My other issue that I am curious about is how to push a variable from LL to tasker. I have figured out how to push one from tasker to LL but don’t know how to do the opposite.
Again if anyone could help me or point me in the right direction, it would be helpful. Thanks for your understanding.
1. ID != name. getContainerById takes an int, not a string.
2. You can run a tasker task from LL script to push a variable.
3. Questions about scripting will receive more attention in the beta community.
Lukas, thanks for your reply but I can’t help but feel I did not get any answers to any of questions. First I understand that ID does not equal in name in the sense that it integer and not a string but when I long click on a panel and the panel number comes up and then I put that panel number into the .getContainetById() it still does not work. Also I realize that it is possible to run a tasker task from a LL script, my problem is I don’t know how. For number 3 I think I will take my original post and post it to the beta community. Thank you for that advice.
A panel (or folder) is both an item and a container. To get the container for the panel:
my_panel.getContainer();
If you set a name to the panel item, you will be able to retrieve it this way:
some_container.getItemByName(‘my_panel_name’).getContainer();
Now you need to know some_container.
This can either be a desktop, maybe the current one, in that case use LL.getCurrentDesktop() or you know its id, in which case use LL.getContainerById(some_id)
When using scripts, ids are integer with the javascript syntax. It can be a plain text number : 1234 or an hexadecimal value : 0x4d2 (it starts with 0x). In the properties box the id is also hexadecimal but prefixed with #. Replace # with 0x and it should work.