__FILE__
(Not TW.__FILE__ no -> TW. )
(This is less reliable than Script properties (fileName etc) as otherwise it may require the User to set the Debugger to be "on" to work.)
So script property TW.script.fileName now depreciates __FILE__
This holds the path and file name of the current script that is running.
For e.g.
"D:/latexportable/LaTexUtils/TeXWorks/texworks/config/scripts/Scripting - Experiments/debugger.js"
Not the document that is being edited (for that see TW.target.fileName).
You can use JavaScript string functions on this to for example get the path of the script folder that you are in.
__FILE__.substr(0, __FILE__.lastIndexOf("/") +1)
In the above example would yield:
"D:/latexportable/LaTexUtils/TeXWorks/texworks/config/scripts/Scripting - Experiments/"
Created with the Personal Edition of HelpNDoc: Free Web Help generator