Scripts
Scripts in Galago provide a powerful way to automate complex tasks and extend the platform’s functionality using Python, C#, or JavaScript. They allow you to create custom automation workflows, data processing routines, and integration with external systems across multiple programming languages.
Table of Contents
Overview
Galago supports scripting in three popular programming languages, allowing you to leverage your existing expertise and choose the best language for your specific automation needs. Whether you prefer Python’s data science libraries, C#’s robust framework, or JavaScript’s flexibility, Galago provides the environment and tools to build powerful automation scripts.
Supported Languages
Python
Full Python 3 environment with extensive library support. Great for data processing, analysis, etc.
Working with Scripts
Script Features
Multi-Language Support
Choose from Python, C#, or JavaScript based on your requirements and expertise.
Package Management
Access to pip (Python), NuGet (C#), and npm (JavaScript) for external dependencies.
Example Scripts
Python Example
from tools.toolbox.variables import get_all_variables
def main():
# Get all system variables
variables = get_all_variables()
for variable in variables:
for key, value in variable.items():
print(f"{key}: {value}")
if __name__ == "__main__":
main()
C# Example
var allVariables = await Variables.GetAllVariablesAsync();
var variableArray = allVariables.EnumerateArray();
foreach (var variable in variableArray)
{
foreach (var prop in variable.EnumerateObject())
{
Console.WriteLine($"{prop.Name}: {prop.Value}");
}
}
JavaScript Example
try {
const allVariables = await Variables.getAllVariables();
for (const variable of allVariables) {
for (const [key, value] of Object.entries(variable)) {
console.log(`${key}: ${value}`);
}
}
} catch (error) {
console.error('Error:', error.message);
}
Warning: Scripts have full access to the Galago API and can modify system state regardless of the programming language used. Always test scripts thoroughly before running them in a production environment.