You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sven Rahn edited this page Jun 29, 2018
·
1 revision
Every script has an individual Script object. The source code is here.
It contains the script ID and the path to the script file. You can also compile and run other scripts with the script object.
val path = script.path // own path to the script file
val configPath = path.parent.resolve("config.conf")
val loader = configPath.toConfigurationLoader()
val myId = script.id
val compiledScripts = script.compile(script.path.parent.resolve("lib.ktskript"))
val libFunctions = compiledScripts["lib"]!!.compiledScript.eval()
// do other stuff, see the 'Scripts as libraries' wiki page