Using AMIScript¶
The Web provides several useful tools for using AMIScript
Custom Methods¶
AMI allows for Custom Methods which can be defined once and used anywhere throughout a layout. To create a custom method, go to Dashboard > Custom Methods then create your methods, see below for an example:
Note
-
Each method must have a
;
after its definition -
Methods can be overloaded, that is, the same method name can be used if it has a different input definition
Debugging¶
Any portion of AMIScript can be debugged using breakpoints, see below for a step-by-step guide:
-
Add a new breakpoint by clicking on the line number of the line you would like to debug.
-
Enter Debug Mode by pressing the "test" button.
-
Action once your breakpoint has been hit, use the Debugger tab at the bottom of the screen to understand the state of your code, when done press "continue" to advance to the next breakpoint
Embedding Python¶
How to load Python Modules in AMI Script¶
To import python modules, place the import statements inside the python extern block.
By default AMI looks for Python Libraries in the lib/Lib directory of amione.
Alternatively, you can also set the JYTHONPATH environmental variable and AMI will load libraries from there.
How to use Python in AMI Script¶
Below is an example of how you can pass in variables and tables and modify and return them: