Passing Variable via BridgeTalk
hello,
everyone here have been fantasic getting me , running palette windows , understanding basics of bridgetalk , needs work. understand serializing message, , loading , running external scripts via opening, reading, , sending them within context of bridgetalk. this....
background:
i have palette window contains listbox of items searches , lists contents of on 400 products (thanks mr. kahrel , scriptui 2.0!). see attached. pic of template below typical items. imprint area shown change depending on product.
script #1:
when user selects product list, selection used open file (illustrator template) item shows guide path box height , width information imprint area on product. opened illustrator document contains artwork working on @ time. artwork copied , pasted newly opened template file.
script #2:
this script contains array of products in palette list. within each index of array, each item contain following information:
example (the name property of each item match name of index box selection script #1):
var itemarray = new array();
//p may saved @ index 0 of itemarray
var p = new object();
p.name ="p- shape p";
p.width = 189;
p.height = 103.5;
p.pos = [300,564];
i need send selection script #1 script #2 can loop through array , find match, @ point information stored in properties of item used scale art , place in correct position on template. there way send variable script #1 containing name of selection via bridgetalk , have stored in variable in script #2? if not, read somewhere might possible write/save disk , have second script read it. always, is invaluable.
klemango
i got work:
var savefile = new file ("c:/users/henryk/desktop/listsel.txt");
savefile.open("r");
var bt = new bridgetalk;
bt.target = "illustrator";
var script = savefile.read();
savefile.close();
bt.body = script;
bt.send();
alert(script);
i used same method invoke scripts scriptui palette. now, need figure out how write selection , overwrite previous info.
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment