|
Using Scripts and Extensions |
|
|
A scripting language is a type of programming language that lets you control and extend the functionality of a software application.
Strata offers a powerful scripting language that enables you to use to perform tasks like coding data analysis routines, interacting with local and web resources and creating new applications using the Strata data engine. The scripting language is an implementation of the ECMAscript (e.g. Javascript) with bindings for SQL and HTTP and includes a class implementation so you can use web APIs and create desktop mashups.
Additional Resources
There are many resources freely available on the web and in technical books that explain how to develop using ECMAscripts. Due to the extensive information related to our implementation of ECMAscript, we provide the language and bindings documentation directly on our website.
In particular, it would be useful to start with the article on Creating, Saving and Running Scripts. Secondly, the Managing Scripts section is also useful for beginners. The full scripting API is also available online.
Please see this information as well as our help section, tips & tricks blog, and user forums for further information on developing scripts.
Opening, Saving and Running Scripts
To create a new script, select New > Script from the File menu and a script editor will appear. You can then begin writing your script in the editor, such as this simple example that pops open a message box that says "Hello World":
alert("Hello World")
Once you have finished writing you script, you can save it by either selecting File > Save or selecting the Save icon on the toolbar. A Save dialog will appear so you can save it to your Project.
To run a script that is open, simply click Run Script/Query from the Tools menu. Additionally, you can right-click the script on the project panel and select Run. And even more efficiently, it is helpful to use the keyboard shortcut Alt+Enter when writing scripts to quickly run them without needing to use a menu at all.
Additionally, when editing a script, it is often useful to be able to jump to a certain line. To do this, use the Go To dialog by selecting Go To from the Edit menu or by using the keyboard shortcut CTRL+G.
Further information on creating scripts can be found online along with a "Hello World" example.
Installing Extensions
Extensions are scripts that have been packaged up so they are more easily deployed and shared with other people. Extensions are denoted as *.kxt files. To add an extension, open up the Extensions dialog by select Extensions from the Tools menu.
To uninstall and extension, simply open the Extensions dialog, click the extension you with to remove and select the Uninstall button. The extension will be uninstalled when you restart the software.
Further information on extensions as well as actual extensions you can download and use can be found at the online extensions section.
Scheduling Scripts
You can schedule scripts to be run at a specific time or series of times in the future by using the Job Scheduler.
Script Preferences
You can also select certain preferences and behavior for the text editor, when you are writing your scripts. To change the preferences, select Options from the Tools menu and then select the Script tab.
You can then change the way your editor looks, including showing line numbers, syntax highlighting and white space characters. You can also change the behavior for how you would like tabs to work.
|