Extendscript current script path
I wrote an article about this you may find helpful, :)
essentially:
var myPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
var myScriptPath = (File(app.activeScript.fullName).parent.fsName).toString().replace(/\\/g, '/');
alert('Document path is: ' + myPath + ' , and script path is: ' + myScriptPath);
mim,
Found it myself, it is $.fileName
For the folder name, it is (new File($.fileName)).parent