🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #464

Re: How to apply stroke to a layer from style menu/blending options?

#464
From: Paul_R
Date: Wed, 04 Feb 2009 15:41
63 lines
2376 bytes
Try this.


 
stroke(20,0,0,256); 

 

function stroke(Pixels,R,G,B ){ 

if(R == undefined) R =0; 

if(G == undefined) G =0; 

if(B == undefined) B =0; 

cTID = function(s) { return app.charIDToTypeID(s); }; 

   var desc205 = new ActionDescriptor(); 

        var ref149 = new ActionReference(); 

        ref149.putProperty( cTID('Prpr'), cTID('Lefx') ); 

        ref149.putEnumerated( cTID('Lyr '), cTID('Ordn'), cTID('Trgt') ); 

    desc205.putReference( cTID('null'), ref149 ); 

        var desc206 = new ActionDescriptor(); 

        desc206.putUnitDouble( cTID('Scl '), cTID('#Prc'), 416.666667 ); 

            var desc207 = new ActionDescriptor(); 

            desc207.putBoolean( cTID('enab'), true ); 

            desc207.putEnumerated( cTID('Styl'), cTID('FStl'), cTID('InsF') ); 

            desc207.putEnumerated( cTID('PntT'), cTID('FrFl'), cTID('SClr') ); 

            desc207.putEnumerated( cTID('Md  '), cTID('BlnM'), cTID('Nrml') ); 

            desc207.putUnitDouble( cTID('Opct'), cTID('#Prc'), 100.000000 ); 

            desc207.putUnitDouble( cTID('Sz  '), cTID('#Pxl'), Pixels ); 

                var desc208 = new ActionDescriptor(); 

                desc208.putDouble( cTID('Rd  '), R ); 

                desc208.putDouble( cTID('Grn '), G ); 

                desc208.putDouble( cTID('Bl  '), B ); 

            desc207.putObject( cTID('Clr '), cTID('RGBC'), desc208 ); 

        desc206.putObject( cTID('FrFX'), cTID('FrFX'), desc207 ); 

    desc205.putObject( cTID('T   '), cTID('Lefx'), desc206 );//cTID('T   ') should be cTID('Tand3spaces') 

    executeAction( cTID('setd'), desc205, DialogModes.NO ); 

}
Technical Details
Message-ID: <59b7c6fd.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing
References: <59b7c6fd.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,30b5516d811a79ea
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!news2.google.com!news.glorb.com!news2.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.photoshop.scripting
Subject: Re: How to apply stroke to a layer from style
 menu/blending options?
Message-ID: <59b7c6fd.0@webcrossing.la2eafNXanI>
Date: Wed, 4 Feb 2009 07:41:34 -0800
References: <59b7c6fd.-1@webcrossing.la2eafNXanI>
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit