Sebastian Schuberth
12/15/2023, 9:30 AM.main.kts
script, args[0]
does not refer to the script itself (like known prom other programming languages), but to first script argument (meaning you'll get an ArrayIndexOutOfBoundsException
if you try to access it while passing no arguments to the script). So, it there another way to get the script's location from the script itself, in order to construct paths relative to it?Sebastian Schuberth
12/15/2023, 9:32 AM__FILE__
does the trick.Sebastian Schuberth
12/15/2023, 9:36 AMVampire
12/15/2023, 10:03 AMVampire
12/15/2023, 10:03 AMVampire
12/15/2023, 10:04 AMAfaik it is the only oneOr well, it depends on the script host used what is available or something like that.