Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to specify opacity of a page item in script?

New Here ,
Oct 01, 2015 Oct 01, 2015

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?

TOPICS
Scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Oct 01, 2015 Oct 01, 2015

Hi,

Try this...

myRectangle.transparencySettings.blendingSettings.opacity = 39;

Regards

Translate
Community Expert ,
Oct 01, 2015 Oct 01, 2015

Moved to the scripting forum...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 01, 2015 Oct 01, 2015

Hi,

Try this...

myRectangle.transparencySettings.blendingSettings.opacity = 39;

Regards

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2015 Oct 01, 2015

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

book for all the javascript commands for indesign scripting?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 02, 2015 Oct 02, 2015
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2015 Oct 03, 2015
LATEST

Thanks a lot. I will check up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines