Hello there! I'm pretty new to this whole coding/scripting thing, so forgive me...
I'm trying to pass a variable to get the relative path to a .jsx file via bridgetalk (From Illustrator to Photoshop if that is of any matter!)
Here's my code:
var scriptPath = (new File($.fileName)).path
//Bridgetalk stuff
var scriptToLoad = new File (scriptPath + "/psScript.jsx") // laddar den rätta skriptfilen
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);
}
#target photoshop-13
var bt = new BridgeTalk();
bt.target = "photoshop";
bt.body = message + scriptPath.toSource();
bt.send();
And on the other end in psScript.jsx I'm just trying to get it to alert me the path in a dialog box:
alert('Script path is: ' + scriptPath);