io lua library seems to be not loaded in a SessionInit script :
ardour {
["type"] = "SessionInit",
name = "Test Template",
author = "An author",
description = "A description"
}
function factory () return function (...)
print(io)
end end
with the following result :
2022-04-18T00:21:12 [INFO]: LuaTemplate: nil
On the other hand, it works very well in the scripting window in Ardour.
Script interpreters are sandboxed (mainly for realtime safeness [1[). Only the GUI Window and Editor-Actions are whitelisted.
I cannot think of a reason why Session-init scripts cannot be whitelisted either, but so far it isn’t.
–
[1] by default neither the os and the io library are available, nor is dofile, loadfile, coroutiine, require. In general anything call that may perform file i/o or syscalls or include external files (which may not be present on other systems) is not allowed.