Automagic scripting language question

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
fractals
Posts: 9
Joined: 12 Mar 2013 15:27

Automagic scripting language question

Post by fractals » 12 Mar 2013 15:45

Hi everyone,

First of all, thanks to the Developer for creating such a great tool! I've been using Tasker for more than 4 years now but decided to try Automagic because it integrates nicely with the brilliant Gleeo time tracker. In the meantime, I've decided to stick with Automagic since it looks at least as powerful as Tasker plus it has the added benefit (and fun factor) of creating flows in a visual way. And on top of that, scripting and variables are a hidden gem and I intend to explore that further.

This brings me to my question. I'd like to know if the scripting used by Automagic is a "pure" implementation of a language (java, javascript, bash script, python or something else) or, in case it's a slightly modified version, what is the "established" scripting language that Automagic has most similarities with (if any)? And what would they be?

Thanks in advance for your answers! :)

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

Re: Automagic scripting language question

Post by Martin » 14 Mar 2013 09:04

The little scripting language used in Automagic looks a bit like java/javascript but was originally only designed to allow simple expressions like "a=3", "b=1+a", logical expressions like "a AND b" and stuff like that. Later we added some features like function calls, if/for/while-expressions (syntax mostly inspired by java).
We also got the inspiration for some of the features from other languages (like ruby if-expression instead of the java ternary operator, javafx/ruby expressions in string literals like a="value is {1+2}" etc.).

Pepy
Posts: 74
Joined: 31 Oct 2018 10:53
Location: Canada

Re: Automagic scripting language question

Post by Pepy » 01 Jul 2019 00:14

@Martin
Since you've taken ideas from so many different languages, I'm curious as to what language you think would be best to use if editing scripts and expressions via another editor?

I know some people choose to use JavaScript but I was wondering if there is an even better choice than that. Also, when saving these files, I give them a ".script" extension, though I'm sure it shouldn't matter what you call it as long as you can open it without the "code" inside getting corrupted.
Newbie to device automation! Hope my post was helpful, useful or informative :D
Device: OnePlus 5T (Dumpling) running crDroid 5.x, rooted via Magisk 8-)

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

Re: Automagic scripting language question

Post by Martin » 06 Jul 2019 19:55

I'm not sure if there's really another language that matches the Automagic scripting language well. I would probably configure an external editor to just highlight the keywords and handle comments in the form /* comment */ and // comment.
Most better text editors should be capable of handling this. You can get the list of keywords from the Script help page: Script.

Regards,
Martin

Post Reply