Skip to main content
prafuls54569274
Participating Frequently
October 1, 2015
Answered

how to specify opacity of a page item in script?

  • October 1, 2015
  • 2 replies
  • 1355 views

In my following script:

var myDoc = app.documents.item(0);

var myPage = app.activeWindow.activePage;

var myBounds = myPage.bounds;

var pageWidth = myBounds[3]-myBounds[1];

var pageHeight = myBounds[2]-myBounds[0];

var myRectangle = myPage.appliedMaster.rectangles.add({geometricBounds:[0, 0, pageHeight, pageWidth]});

myRectangle.fillColor = "Black";

myRectangle.strokeWeight = "0";

I want to change opacity of the myRectangle object.

Can anyone help me with the correct command to specify opacity in javascript?

This topic has been closed for replies.
Correct answer Ronald63

Hi,

Try this...

myRectangle.transparencySettings.blendingSettings.opacity = 39;

Regards

2 replies

Ronald63Correct answer
Legend
October 1, 2015

Hi,

Try this...

myRectangle.transparencySettings.blendingSettings.opacity = 39;

Regards

prafuls54569274
Participating Frequently
October 2, 2015

Thank you very much. One more favor pls... Can u suggest me some reference

book for all the javascript commands for indesign scripting?

Legend
October 2, 2015
Peter Spier
Community Expert
Community Expert
October 1, 2015

Moved to the scripting forum...