//Changes the opacity of all Live Effects on selected objects //Aaron Beall - http://abeall.com var sel = new Array().concat(fw.selection); if(sel.length <= 0){ alert('This command requires an active selection!'); }else{ var error = ""; do{ var amount = prompt(error+'Enter an amount from 0-100 to set all Live Effects Opacity/Strength.\n\nRecognized Effect values include: Glow, Shadow, and Color Fill Opacity, Bevel and Emboss Contrast, and Add Noise Amount.'); error = "You need to enter a valid number.\n\n"; } while(isNaN(Number(amount)) && amount!==null); if(amount!==null){ amount = Math.min(100,Math.max(0,parseInt(amount))); for(var i in sel){ if(!sel[i].effectList)continue; var effs = sel[i].effectList.effects; for(f in effs){ if(effs[f].EffectIsVisible){ var eff = {}; for(var p in effs[f]){ if(p!='javascriptString')eff[p] = effs[f][p]; } if(eff.Opacity!=undefined)eff.Opacity = amount; if(eff.BevelContrast!=undefined)eff.BevelContrast = amount; if(eff.add_noise_amount!=undefined)eff.add_noise_amount = amount; if(eff.ShadowColor!=undefined)eff.ShadowColor=eff.ShadowColor.substr(0,7)+Number((amount/100)*255).toString(16); effs[f] = eff; } } } } }