I thought that might be the case. Thanks.
For reference, this code seems to work (written with reference to Andrew Pask's post in
this thread) :
function findconnections()
{
post("Finding connections!\n");
lines="";
var patcher_file = new File(this.patcher.filepath);
while (patcher_file.position != patcher_file.eof)
{
lines += patcher_file.readline();
}
patcher_file.close();
var parsed_patcher = JSON.parse(lines);
post("Num patch cords: " + parsed_patcher["patcher"]["lines"].length + "\n");
for ( i = 0; i < parsed_patcher["patcher"]["lines"].length ; i++ )
{
destin = parsed_patcher["patcher"]["lines"][i]["patchline"]["destination"][0];
dinlet = parsed_patcher["patcher"]["lines"][i]["patchline"]["destination"][1];
source = parsed_patcher["patcher"]["lines"][i]["patchline"]["source"][0];
soutlet = parsed_patcher["patcher"]["lines"][i]["patchline"]["source"][1];
post("Connection from " + source + " (out:" + soutlet + ") to " + destin + " (in:" + dinlet + ")\n");
}
post("Finished!\n");
}
Cheers,
Aengus.