public Macro(File macro, RecordModel model) {
        BufferedReader br = null;
        this.model = model;
        try {
            br = new BufferedReader(new FileReader(macro));
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) {
                sb.append(line);
                sb.append("\n");
                line = br.readLine();
            }
            script = sb.toString();
            br.close();
            try {
                jsbot = new JsBot(new SmartRobot());
            } catch (AWTException ex) {
                Console.Log("Couldn't created the robot.");
            }
            js = new ScriptEngineManager().getEngineByName("JavaScript");
        } catch (FileNotFoundException ex) {
            Console.Log("Couldn't find the .js file.");
        } catch (IOException ex) {
            Console.Log("Oops! IOException in Macro constructor.");
        }finally {
            try {
                br.close();
            } catch (IOException | NullPointerException ex) {
                Console.Log("Failed to close the .js file stream.");
            }
        }
    }