Article View: adobe.photoshop.scripting
Article #83Re: Opacity
From: Paul_R
Date: Fri, 03 Apr 2009 16:52
Date: Fri, 03 Apr 2009 16:52
59 lines
1606 bytes
1606 bytes
Something like this... //This is just a test script #target photoshop //bring application forward for double-click event app.bringToFront(); var current_units = preferences.rulerUnits; app.preferences.rulerUnits = Units.PIXELS documents.add(1920,1080) //create a new art layer at the beginning of the current document var layerRef = app.activeDocument.artLayers.add() layerRef.name = "Background2" layerRef.blendMode = BlendMode.NORMAL //Set opacity of new layer layerRef.opacity=60; //Select all so we can apply a fill to the selection app.activeDocument.selection.selectAll //create a color to used with the fill command var colorRef = new SolidColor colorRef.rgb.red = 0 colorRef.rgb.green = 0 colorRef.rgb.blue = 0 //Now apply fill to current selection app.activeDocument.selection.fill(colorRef); app.activeDocument.selection.deselect(); preferences.rulerUnits = current_units;
Technical Details
Message-ID:
<59b8808e.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b8808e.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,3efd978cef8ed09a X-Google-Attributes: gidf5839,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Paul_R@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.photoshop.scripting Subject: Re: Opacity Message-ID: <59b8808e.0@webcrossing.la2eafNXanI> Date: Fri, 3 Apr 2009 09:52:56 -0700 References: <59b8808e.-1@webcrossing.la2eafNXanI> Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit