“How does scripting work???”

“How does scripting work???”

Well, I was about to post that question after for about an hour I struggled badly with scripting. First thought: “Hey, how hard can it be? You’re a developer pro.”… and honestly: it is hard. Very hard. Really, I was about to give up. But then decided to use my notebook side by side with my tablet.

Here are some findings and suggestions.

0) I started creating a shortcut with action “Run script”. Added some basic lines, positioning the home desktop. Surprisingly it worked. 

1) Opening Editor

But how the hell to edit the script?? Took me ages and finally found the posting pointing to “Script Editor” in “All apps”. It should be easier, waaay easier to go to the editor. In my example, in the shortcut’s configuration it should be possible to launch the editor for that script.

EDIT: I see when in “+” tab “Run script” is chosen as an action for “tap” or a gesture, it is possible to enter the editor by tapping that action and choosing again “Run script”. But there’s no way if a shortcut directly is set to “LL Action >> Run script”.

2) Keyboard mode

When editong script, the keyboard should be set to “autocomplete off” or “autocorrect off”. When in Zooper editing “advanced options” (manual text also IIRC) for example it is off, so typed text is not “corrected” (here: destroyed) by the keyboard.

3) Editor or “Edit…”

Opening help in browser and going back works good so far. But was is the difference between “Edit…” and the editor I’m already in? Is it currently just an alternative to the first editor and only one will be in the final release? I’m confused.

4) “Intellisense” / Autocomplete

I’m a .NET professional and Visual Studio has stunning “Intellisense” which when just typing a few characters shows possible types, methods, etc. I do not ask for that level of guidance, but I really think there has to be be some help of any kind.

My thought: many keyboards with auto-complete feature show suggestions or alternatives in a scrollable bar. Let’s say I have a Desktop object called  “dtHome”, so when I type “dtHome.” (dot at the end) a bar might show the methods and properties possible in bar (or 2 or 3 lines), which dynamically adjusts as I continue typing.

This would (for everyone, not just beginners) dramatically help editing scripts without switching back and forth between editor and help.

5) Syntax check

For fun I just entered “var test = LL.gethome();”. There was no sign (a) the casing is wrong (“getHome”) and (b) the method does not exist at all. Syntax (even rudimentary) should at least be validated when leaving the editor.

6) Syntax highlighting

Color coding objects, methods, parameters etc would help. But this is low priority since scripts probably won’t be very long.

7) Debugging

Any kind of debugging functionality would be of great help. Break points for example.

Idea:

If I set a breakpoint at a specific line, when the script is executed and the breakpoint reached, a semitransparent overlay could pop up over the desktop showing the current portion of the script.

Buttons: “Play” = continue, “Single step”. And maybe a button to switch the position of the debug overlay (top, middle, bottom should be sufficient).

I possible: a line showing an objects most useful properties (like ID, position etc) when clicked in shown code.

Well… seems though I call myself a “Pro” developer I might think about wether I’m really “Pro” when I’m already too dependent on such kind of assistance 😉

EDIT: Pierre Hébert , though I currently have no ideas for what I might do with scripting, it really is a VERY powerful feature, big thumbs up. Even if only for a few. There already are some great postings in “Scripts” section.

]]>
(Next Post) »

16 Commentsto “How does scripting work???”

  1. Anonymous says:

    < ![CDATA[

    All I can suggest is to install Droid Edit from playstore, and see if that doesn’t get you at least a quarter of the way there. (#3)

    ]]>

  2. Anonymous says:

    < ![CDATA[

    i admire your skills Lutz Linke i have faith that you will figure it out because i couldnt picture any of what youre talking about. If only i cared enough to pay attention in school and actually did my Homework. Then again i suffered low gpa no matter how hard i tried anyway.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Chris Chastain Will give it a try, thanks for the hint (link by the way: https://play.google.com/store/apps/details?id=com.aor.droidedit).



    (Looks like the editor I saw earlier was the one of ES File Explorer, much better with DroidEdit!!)

    ]]>

  4. Anonymous says:

    < ![CDATA[

    That being said, I’m trying to learn JavaScript, but the whole editor thing is not very intuitional, agreed.


    Edit: intuitive I don’t know where intuitional came from. That’s not even a word!

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Re editing: there are some very nice , free, Android Java IDE’s which do many of the things you talk about here. Just as we have a choice between the Lightning file manager or an external file/pic manager of our choice when setting properties of objects, it would be great to be able to have a choice between using the small lightning script editor, or to hook into a more elaborate development app. IMHO the current lightning script editor is sufficient. I was expecting to be writing code with notepad so the script editor seems like a bonus 🙂 Trying to enhance it very much, when there are already existing tools to do the same thing, wouldn’t be the best to use of that gigantic brain of Pierre’s, and could lead to unnecessary bloat…

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Carolyn Boyle I agree, it’s great Pierre allows to use external editor like DroidEdit. Solves many of the issues (color coding i.e.) But I still do think script-developers need some more guidance. As for syntax check, maybe there is an editor that supports something like dictionaries. That would also help.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    In order to edit existing scripts, use the new script editor icon that should appear in the app drawer. Since it will open on the last edited script, this is quite convenient for edit/run cycles.


    I would like to emphasize on the fact that the script editor is not an IDE, and I don’t plan to implement one. As of today the script engine isn’t designed for fast and complex processing. These scripts should be kept short, their purpose is not to become apps in the app, but more to be the missing glue between other components.


    A robust script engine and an advanced editor would add 2MB to the app, no more, no less. I even thought at providing this as a plugin. But the current implementation is so lightweight that for small tasks I think it’s current feature level is appropriate.

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Pierre Hébert Understood and agreed. I was asking for way too much. So I might gonna close this post, enough is said.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Please leave it open, I don’t pretend that my point of view is the best and only one, someone may have something more to say

    ]]>

  10. Anonymous says:

    < ![CDATA[

    LOL


    Lutz Linke : you needed 3 pages of text.


    Pierre Hébert : needed 3 letters: IDE



    @Lutz If you think coming from .NET that JS is difficult… I am a COBOL programmer…. Like Pierre said: “start small” but you did that already.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    The strange thing with JavaScript is that it is easy to use at first, but few people really understand how it really works.


    I am not experienced with .NET myself but Java environments like IntelliJ, Netbeans or maybe Eclipse are similar. So I understand what Lutz Linke is expecting, and the truth is that once you worked with such tools, it is very difficult to come back to simpler editor!

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Pierre Hébert you’re right about it being difficult to go back to the simpler editor. The first computer I got paid to write code on was an Apple IIc with 10 kb of memory. 

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Mine was a Mac SE, with a 8MHz 68000 🙂

    ]]>

  14. Anonymous says:

    < ![CDATA[

    Pierre Hébert hey, that mac was a hotrod! Back then. Now its a novelty door stop.

    ]]>

  15. Anonymous says:

    < ![CDATA[

    Jappie Toutenhoofd oops, you are so right. Was writing that posting on the pc while playing with scripting on the mobile. It just grew, did not realize.

    ]]>

  16. Anonymous says:

    < ![CDATA[

    Pierre Hébert Carolyn Boyle Jappie Toutenhoofd Commodore C64 back in the ’90s, BASIC, then demo coding in assembler. Next Pascal on PC (DOS). Shell scripts on Unix in vi. Been on that side, too 😉


    I’m used to JavaScript, too, but not lately. It’s a good choice for scripting. Easy, yet powerful.

    ]]>

Leave a Reply

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