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

Help With Script That Apply Blend Mode:Multiply To All Graphic

New Here ,
Jul 25, 2013 Jul 25, 2013

Copy link to clipboard

Copied

Hi!

I need some help with script...after i select some pictures instead of pressing SHIFT + ESC and applying effect manually with mouse  i  want script to do it automaticlly.

if someone have some guide or links i will be very grateful.

EDIT: maybe i didn't explain good enough, so after place some image in indesign i want that  the script , create "Graphic Effect"  (Transparency > Mode > Multiply) - as is in the video

https://docs.google.com/file/d/0Bzq39-uGEZVhTkt0Ml85Tm12M1U/edit?usp=sharing

EDIT2:

var myDoc = app.select(app.activeWindow.activePage.allGraphics);

myDoc.contentTransparencySettings.blendingSettings.FindChangeBlendingSetting.BlendMode.multiply;

i get the error "undefined is not an object"

TOPICS
Scripting

Views

1.6K

Translate

Translate

Report

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
Contributor ,
Jul 25, 2013 Jul 25, 2013

Copy link to clipboard

Copied

Hi.

try code below.

I think it is unnecessary to select the objects

var graphics = app.activeWindow.activePage.allGraphics;

app.select(graphics); //=>  undefined. because select method return undefined

// apply filter to each graphic

var i = graphics.length;

while (i--) {

  graphics.transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;

};

thank you

mg.

Votes

Translate

Translate

Report

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 ,
Jul 26, 2013 Jul 26, 2013

Copy link to clipboard

Copied

thnx it's working i have just one question

var i = graphics.length;

lenght is how much objects is selected? thna you itereated every graphic object ?

Votes

Translate

Translate

Report

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
Contributor ,
Jul 26, 2013 Jul 26, 2013

Copy link to clipboard

Copied

Yes every graphic. (=.allGraphics)

if you want to apply only selected object

for example

var sel = app.selection; // graphic container;

var i = sel.length;

while (i--) {

  try {

    sel.graphics[0].transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;

  }

  catch(e){}

};

thank you

mg.

Votes

Translate

Translate

Report

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 ,
Jul 26, 2013 Jul 26, 2013

Copy link to clipboard

Copied

LATEST

selecting all (instead CTRL + A)

app.select(app.activeWindow.activePage.allPageItems);

after i run this in editor, i get selected rectengules (frames) and graphics, how to select just rectengules i whont to apply tham an object style or maybe it's better to say, all frames that have graphic in themselves.

Votes

Translate

Translate

Report

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