views:

288

answers:

1

Within the InDesign CS4 designer, I can very easily make a TextArea transparent. I just right click on the TextArea within a document, select Effects-->Transparency, and within the “Effects” window that launches, I can set the “Opacity” to 0% on the Fill settings.

I am attempting to figure out a way to make a TextArea transparent via javascript. I initially thought that I could do this by applying an ObjectStyle via something similar to the code below:

//open document
var myDocument = app.open(new File(designFileName));
//grab the appropriate layer
var contentLayer = myDocument.layers.item("ContentLayer");
//create an objectstyle
var transparentObjStyle =  myDocument.objectStyles.add({name:"TransparentObjStyle", opacity:0});
//apply that object style to the document
contentLayer.textFrames[0].applyObjectStyle(transparentObjStyle, true);
//close the document

It is close. It makes the TextArea transparent, but it leaves a black box around the border of the TextArea. Has anyone done anything like this and have any suggestions on how to proceed?

A: 

You can try: visibility:hidden instead of opacity:0

Aron
Thanks for the response. I tried visibility:hidden, but I'm still seeing the border around the outside edge of the TextFrame
Well try display:none then. If you still have the border than it's probably set to another element.You can try to just disable the border first like "Jack" said with "border:none" to see if that works...
Aron