Get script path in a more accurate way