Hi all,
I got a reply from Rick Quatro off-list. Good to share it here, in case someone else is looking for the same thing. The answer is simple: the $ object contains all the information needed about the script that is being executed. I associated the $ object with the application, but it is the script that this is about. So the current location of the script that is being executed is available via $.filename. All $ object properties are listed on page 217 of the JavaScript Tools Guide (version Adobe Creative Suite 5).
Ciao
Jang