Writing Scripts โ
Foxel provides a large Lua API that allows scripts to interact with many parts of the application. For a full reference of available modules and functions, see the API documentation.
Foxel scripts are standard Lua scripts. A practical way to learn the Foxel API is by watching the calls Foxel writes to the log while you work. Many actions performed in the user interface produce corresponding API calls, including the parameters used.
API Call Logging โ
API calls are written to the system log file:
Documents\Foxel\Log\system.log
They are also shown in the console window.
Example โ
For example, Foxel may log a line like this:
2025-06-19 15:01:57 API : FxFile.Open(111, "Asset1");The part after API : is the relevant function call:
FxFile.Open(111, "Asset1");This shows that Foxel called the function Open from the FxFile module with two parameters.
Using Modules โ
Before calling functions from a module in your own script, you need to load that module with require:
FxFile = require "FxFile"After that, you can call functions from the module in your script.
Learning from Logged Calls โ
Reading logged API calls is a useful way to understand how Foxel's scripting API works in practice. You can inspect which functions are used for specific actions, then adapt those calls for your own scripts.
This is especially helpful when you want to automate tasks that you already know how to perform in the user interface.