Script Editor

Post your questions and help other users.

Moderator: Martin

Post Reply
ryanwagner
Posts: 5
Joined: 16 Aug 2013 14:02

Script Editor

Post by ryanwagner » 17 Nov 2013 20:15

I'm using the "Script" action in a few different flows, and in one of them I have a decently long script (about 130 lines). Just wanted to give you a heads up that it appears the syntax highlighting appears to cause some real performance problems with a script that long. On my Nexus 5 it can now take about 1-2 seconds for each letter to appear since it seems to regenerate the syntax highlighting for the entire script on each letter press. I'm assuming that's what it is since all of the syntax highlighting goes away while it "processes" the character I just typed. For that reason it might be nice to have an option to disable the syntax highlighting.

Also, this isn't a bug report as much as a feature request, but it would be cool if the script editor had some sort of indentation feature. At least something that maintained the previous line's indentation when you press enter/return would be really helpful for long scripts.

I'm probably using this Script action for much more than what it was intended, but thought I'd give you a heads up anyway. Thanks again for the great app!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Script Editor

Post by Martin » 18 Nov 2013 10:13

130 lines of code is a bit more than I expected :-)
Can you please send the script or the entire flow containing the script to info@automagic4android.com so I can profile the editor highlighting/error checking for this particular script. I recommend to split the script into multiple smaller script actions to get decent performance for each part of the script until the editor works better for large scripts.
Is there a particular function I could add to the built-in functions of Automagic that would reduce the length of the script?

Adding auto indent or a simple format function would be great. I add it to the todo-list but it might take some time to become available.

Post Reply