English 中文(简体)
InDesign CS4 - Javascript - Make a TextArea Transparent
原标题:

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?

问题回答

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





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签