use exec and temporary file to interact with casperjs