Enhanced script parser.