I am working on a script that exports JPGs out of Illustrator and uses bridge talk to open the image in Photoshop to set it to the proper final size. I want to take the contents of a textbox in AI (a string, can also be an array if that will work) and add that to the keywords info when the image is opened in PS. Not sure if this is the correct forum for this, wasn't sure if I should post in AI scripting/PS scripting/or BR scripting!
I have tried using the bt.headers and can add the content to the header, but when I try to extract it in the body of the bridgetalk message it breaks the script. Any ideas of what I could be missing? The code I am trying to use is:
doc.info.keywords = jpgsToOpen.headers.info;
------------------------------------------------------------------------------------------ ------------------
openFile = new File(base_filename + '.jpg') var jpgsToOpen = new BridgeTalk; jpgsToOpen.headers.info = textPullContent; jpgsToOpen.target = "photoshop"; jpgsToOpen.body = 'app.displayDialogs = DialogModes.NO; app.open(File("'+openFile+'")); var doc = app.activeDocument; doc.info.keywords = jpgsToOpen.headers.info; fWidth = 1500; var fHeight = 1125; if (doc.height > doc.width) {doc.resizeImage(null,UnitValue(fHeight,"px"),150,ResampleMethod.BICUBIC);}else {doc.resizeImage(UnitValue(fWidth,"px"),null,150,ResampleMethod.BICUBIC);} jpgSaveOptions = new JPEGSaveOptions(); jpgSaveOptions.embedColorProfile = true; jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE; jpgSaveOptions.matte = MatteType.NONE; jpgSaveOptions.quality = 12; app.activeDocument.saveAs(File("'+openFile+'"+".jpg"), jpgSaveOptions, true,Extension.LOWERCASE); doc.close(SaveOptions.DONOTSAVECHANGES);'; jpgsToOpen.send();
When I remove the keywords portion listed above, everything else works! So the only issue is sending that variable via bridgeTalk. I have been scouring for easy to understand BridgeTalk demos, but am at a loss!