Update script.js

add option rootToDirName
altId is the file dir then fix to dir name