I get undefined.
Sorry, typo: $.fileName
(Not sure if this works on Server, though).
No error but no output. I wrote typeof($.fileName) to a file and it is a string but its empty.
I wrote this simple script that gives me a list of all values in an object and a strange/funny thing is that fileName changes after an $.evalFile() to the path of the included file. But if I run it without includes the string is empty.
Funny enough the DOM for IDS stands app.activeScript is a valid property but when I try to use it I also get an error.
If you need to load libraries, you may need to use the full path if you can foresee it. Or rebuilt it dynamically using some base uri info that can be passed as argument to you indesign call.