now browsing by tag
It might be my imagination, but i thought there was a script which had really cool material folder opening and…
A few weeks ago i posted some script ideas I thought I wouldn’t have time for to make.
With this script you can create a custom view which you can use as log while developing other scripts. For more information see my post from a few weeks ago: https://plus.google.com/100430440392224314007/posts/jMArUGsCeL2
Download and more info on how to use etc.: http://www.lightninglauncher.com/wiki/doku.php?id=script_customviewlog
Please leave any questions/comments/feedback below :)
]]>Hi, 2 things I can’t get to work:
1: enabling scrollbar on a custom textview. setVerticalScrollBarEnabled(true) just runs normally and isVerticalScrollBarEnabled() returns true, but I still don’t see a scrollbar
2: importing android.view. LL.bindclass(“android.view”) returns false and i need this because i want to enable fling to my textview.
Any help is very much appreciated 🙂
]]>Hi, I’ve had so many ideas for scripts recently and I’ve come to the conclusion that it would take ages before they…
1: logscript
This script will when run in a container will make a custom text view. There should be a function named log(String) in it so you can eval(logscript) and use this function in every script you like. I want this because the alert() function kinda disrupts the script flow and if you run alert() in a loop it might take a lot of pressing “ok” before you get the one you want and it’s really easy to skip it. A scrollable text view would be much more convenient I think :).
The script could also have en error catching function done like this: if the script text is not in a container or on create/destroy of the custom view, then it is run in an eval(), so LL.getCurrentScript() will return the script with the eval() in it. You can then get it’s text, remove the line where it says eval(logscript) and then eval() the script text in a try-catch in the logscript, so you can log the error in the custom view (in red text would be nice 🙂 ). (Sorry for my pour explanation skills, but hopefully you get the idea).
This would be useful because really often when I’m scripting I get an error and then I start thinking of why it might be caused and after a while i’m like: what was the error again exactly? And then I have to run the script again and do all the things that make it work and it gets really repetitive and annoying.
2: Script manager
I know there already is a script manager, so this will just be a few feature suggestions I guess.
2.1: the way i originally imagined it was a script that when run in a container would make shortcuts for all the scripts in that container. On tap of the shortcut it would open the script in the default script editor. Opening with another app of choice would be nice too.
The reason this is the way i would like it is that I have quite a lot of scripts and I have to scroll a lot before i find the one I’m looking for. In a panel i could order the items in a grid, which would be much easier to navigate I think. Also we could do all the cool stuff with items and panels that are in LL bent default, for example making folders and changing icons and make even more panels. The options menu would probably a little harder, but the script that sets up your app drawer in any container has is to, so it is definitely possible. And if even that fails it would also be possible to just pop in some items which serve as the list items.
2.2 not only search function for script text, but also for script name. Just like it is in the app drawer for apps. It would be nice if it also recursively searches containers in the main script container, so folders and panels.
2.3 sort by name and modified date. If you have to assume scripts editor is only lanched from the panel it’s fine imo.
2.4 one last thing: automatic grouping of different versions of one script in folders. I think this can be done by checking if a script name has a number at the end and if so search for other scripts with the same name without the version number.
3: better script editor
it might be better that this is done in an entirely separate app, or that Pierre Hébert just improves the script editor, but if everything else gets finished before that, i’m definitely going to work on it. So this editor would have the following features:
3.1: integration with the script editor, so script manager can open scripts
3.2: also give autocomplete options for custom variablenames and functions
3.3: only give autocomplete options available for the object. For example: if I type “item.get” it would not give getCurrentDesktop() as available option.
3.4 autocomplete suggestions for functions also display the arguments that the function takes (and maybe colors an argument red if it’s not of the right type?)
3.5 autocomplete suggestions are displayed in a list to the right from the cursor with the currently selected suggestion see through, so if I for example type “item.getp” it would put the letters “ositionX()” after if it in green text or something and then put a box around “item.getpositionX()”. If i then tap that box, or enter “.” or “)” or some other character I could continue with it will change it to “getPositionX()” (note the difference in the “p”).
3.6 autocomplete suggestions are sorted in alphabetical order and the ones that come before the currently selected one will be displayed on top of the box of the selected one in their own boxes. The same for the ones that come after the selected one, but that beneath the box of the selected one. The boxes should certainly not overlap the keyboard though.
3.7 the currently selected autocomplete suggestion is determined by where on the screen you’re typing. For example if you are typing just above your keyboard the selected suggestion is the last one of the list of suggestions that fits on the screen and if your typing on top it would be the topmost.
3.8 last but not least: of you have LL.bindClass() somewhere in your script the corresponding library will be added to the autocomplete system.
3.9: I think this has already been suggested once or twice, but long tap on an autocomplete suggestion should show a popup with explanation of it is a function or a static value
3.10 syntax highlighting
3.11 autoclose (), {}, “” and [] and if everything is closed also insert ; before enter to next line
3.12 auto-indentation
3.13 ability to select a bunch of text and indent/unindent(?)
3.14 search and replace
I know this is currently in the script manager, but i think it belongs in the editor
3.15 buttons for () , {} and other characters often used in coding (just like in quoda). I personally don’t need the ones with the numbers, the 2 rightmost ones and the left most one because I’ve no idea what those things do
I know i’m asking for quite a lot, but i think it is better to throw the entire list of desired features a out at once instead of one after the other. I know this has been quite a log post, so if you got this far thank you for reading and I hope to see your response in the comments 🙂
Regards Colin de Roos
]]>Hi, this might be a stupid question, but how can I use the Property class in the script api.
Thanks in advance 🙂
Colin
]]>Is possible to set a binding with scipts? If so, how?
Hi, 2 questions:
1: if i were to create a new item and would want to animate the movement of that item with bindings, how would I do that only using scripting?
2: is there any way to let the add item interface (with all the shortcut, app, widget, stoppoint etc. Buttons) pop up and then get the item that is added? (Maybe with getting the view for that from ll itself if necessary). And if this is even possible, could I maybe edit the view so that it only shows options for an app, or shortcut or blank item. I know I could kinda recreate the view myself, but getting it from ll would be better I think.
Thanks in advance 🙂
Colin
]]>Hi, I updated to 12.6 of a few days ago and I’m getting really weird behaviour:
1: Each time I edit some property of a desktop via scripting the resumed event of that desktop doesn’t fire anymore. A restart fixes the event, but the same keeps happening after editing any desktop property.
2: this may not be only in this version, but if I have an item of which the touch event is set to run this script:
var x = event.getX();
var y = event.getY();
item.setLabel(x+”, “+y);
item.getParent().setPosition(x,y);
When you touch the item you get a sort of planning effect: dragging to the left of the items xposition, the desktop moves to the left too. (This works for all 4 directions btw) But if you either set the display of the label of the item to false, or you comment out the line: “item.setLabel(x+”, “+y);”, it gets really laggy and slow.
I’m hoping this is reproducable, because it would really suck if it can’t be fixed.
Thanks for reading 🙂
Colin
]]>Hi, 2 questions:
1: what are the wallpaper tap and secondary tap actions for? I tried setting these on the tap of an item and the tap on empty space of the desktop to run a script, but when I tap the item nothing happens. So is it bugged out or am I doing something wrong here?
2: is there no way of setting de background of a container via scripting or am I missing something?
Thanks in advance 🙂
]]>