var script_name = "ui_demo.jsx"; var currentPath = (new File($.fileName)).path; // retrieve the current script path var scriptToLoad = new File (currentPath + "/"+script_name); // the script to load try { if (!scriptToLoad.exists) { throw new Error("script not found!"); } scriptToLoad.open ("r"); // read only var message = scriptToLoad.read(); scriptToLoad.close(); } catch (error) { alert("Error parsing the file: " + error.description); } var bt = new BridgeTalk(); bt.target = "photoshop"; bt.body = message; bt.send();