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

Add a Stroke Layer Style / Effect to the Active Layer ExtendScript

Engaged ,
Oct 29, 2016 Oct 29, 2016

I'm really, really struggling with this and I can't find any good examples for adding a stroke.  Let's say I have a smart object and I want to add a stroke Layer Style to it that is only 1 pixel in size, is positioned on the inside, has 100% opacity and is solid black in color.  I cannot figure out how to create a script that will add this specific layer style to the currently selected layer.  (Remember, it should work for smart objects as well as regular layers.)  How should I go about doing this?  Can somebody please give me an example of applying a stroke layer style to a smart object layer using ExtendScript and Javascript for Photoshop?

TOPICS
Actions and scripting
8.1K
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

Participant , Nov 05, 2016 Nov 05, 2016

I know this is now an old post, but figured I'd reply with an answer and a somewhat flexible script.

The only parameters I exposed in this function were size, color, opacity and position.

With the ScriptingListener plug-in you will get the ActionDescriptor code generated by Photoshop when you execute almost any action inside of PS. It's pretty easy to install, but it's not easy to read or understand, that will require a lot of testing on your end.

Installing and using the ScriptingListener plug-in

...
Translate
Adobe
Enthusiast ,
Oct 29, 2016 Oct 29, 2016

I would use JAM framework: JsDoc Reference - jamStyles

JSON Action Manager | Tonton Pixel

In a certain sense it is a framework like jQuery is framework for the web.

Otherwise you can use this:

var idsetd = charIDToTypeID( "setd" );

    var desc55 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref19 = new ActionReference();

        var idPrpr = charIDToTypeID( "Prpr" );

        var idLefx = charIDToTypeID( "Lefx" );

        ref19.putProperty( idPrpr, idLefx );

        var idLyr = charIDToTypeID( "Lyr " );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref19.putEnumerated( idLyr, idOrdn, idTrgt );

    desc55.putReference( idnull, ref19 );

    var idT = charIDToTypeID( "T   " );

        var desc56 = new ActionDescriptor();

        var idScl = charIDToTypeID( "Scl " );

        var idPrc = charIDToTypeID( "#Prc" );

        desc56.putUnitDouble( idScl, idPrc, 100.000000 );

        var idFrFX = charIDToTypeID( "FrFX" );

            var desc57 = new ActionDescriptor();

            var idenab = charIDToTypeID( "enab" );

            desc57.putBoolean( idenab, true );

            var idpresent = stringIDToTypeID( "present" );

            desc57.putBoolean( idpresent, true );

            var idshowInDialog = stringIDToTypeID( "showInDialog" );

            desc57.putBoolean( idshowInDialog, true );

            var idStyl = charIDToTypeID( "Styl" );

            var idFStl = charIDToTypeID( "FStl" );

            var idInsF = charIDToTypeID( "InsF" );

            desc57.putEnumerated( idStyl, idFStl, idInsF );

            var idPntT = charIDToTypeID( "PntT" );

            var idFrFl = charIDToTypeID( "FrFl" );

            var idSClr = charIDToTypeID( "SClr" );

            desc57.putEnumerated( idPntT, idFrFl, idSClr );

            var idMd = charIDToTypeID( "Md  " );

            var idBlnM = charIDToTypeID( "BlnM" );

            var idNrml = charIDToTypeID( "Nrml" );

            desc57.putEnumerated( idMd, idBlnM, idNrml );

            var idOpct = charIDToTypeID( "Opct" );

            var idPrc = charIDToTypeID( "#Prc" );

            desc57.putUnitDouble( idOpct, idPrc, 100.000000 );

            var idSz = charIDToTypeID( "Sz  " );

            var idPxl = charIDToTypeID( "#Pxl" );

            desc57.putUnitDouble( idSz, idPxl, 10.000000 );

            var idClr = charIDToTypeID( "Clr " );

                var desc58 = new ActionDescriptor();

                var idRd = charIDToTypeID( "Rd  " );

                desc58.putDouble( idRd, 0.000000 );

                var idGrn = charIDToTypeID( "Grn " );

                desc58.putDouble( idGrn, 180.015568 );

                var idBl = charIDToTypeID( "Bl  " );

                desc58.putDouble( idBl, 255.000000 );

            var idRGBC = charIDToTypeID( "RGBC" );

            desc57.putObject( idClr, idRGBC, desc58 );

            var idoverprint = stringIDToTypeID( "overprint" );

            desc57.putBoolean( idoverprint, false );

        var idFrFX = charIDToTypeID( "FrFX" );

        desc56.putObject( idFrFX, idFrFX, desc57 );

    var idLefx = charIDToTypeID( "Lefx" );

    desc55.putObject( idT, idLefx, desc56 );

executeAction( idsetd, desc55, DialogModes.NO );

But this in not much readable code and it destroy other styles.

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
Engaged ,
Oct 30, 2016 Oct 30, 2016

I cannot get the code that you provided to work for some reason.  May I ask how you were able to generate it?  I haven't been able to try the JAM framework yet.

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
Participant ,
Nov 05, 2016 Nov 05, 2016

I know this is now an old post, but figured I'd reply with an answer and a somewhat flexible script.

The only parameters I exposed in this function were size, color, opacity and position.

With the ScriptingListener plug-in you will get the ActionDescriptor code generated by Photoshop when you execute almost any action inside of PS. It's pretty easy to install, but it's not easy to read or understand, that will require a lot of testing on your end.

Installing and using the ScriptingListener plug-in  - Adobe Photoshop Scripting | Adobe Developer Connection

// Add Stroke to layer

// Javier Aroche

// Set color as HEX

var strokeColor = new RGBColor();

strokeColor.hexValue = '000000';

addStroke(1, strokeColor, 100, 'inside');

/*

* Add Stroke Effect

* @param {Number} size : 1 - 250

* @param {Object} color : RGBColor object

* @param {Number} opacity : 0 - 100

* @param {Number} position : center / outside / inside

*/

function addStroke(size, color, opacity, position) {

    var strokePosCharID;

   

    switch(position) {

        case 'center':

            strokePosCharID = 'CtrF';

            break;

        case 'outside':

            strokePosCharID = 'OutF';

            break;

        case 'inside':

            strokePosCharID = 'InsF';

            break;

        default: break;

    }

   

    var desc = new ActionDescriptor();

    var ref190 = new ActionReference();

   

    ref190.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "Lefx" ) );

    ref190.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

    desc.putReference( charIDToTypeID( "null" ), ref190 );

    var fxDesc = new ActionDescriptor();

   

    var fxPropDesc = new ActionDescriptor();

    fxPropDesc.putBoolean( charIDToTypeID( "enab" ), true );

    fxPropDesc.putBoolean( stringIDToTypeID( "present" ), true );

    fxPropDesc.putBoolean( stringIDToTypeID( "showInDialog" ), true );

    fxPropDesc.putEnumerated( charIDToTypeID( "Styl" ), charIDToTypeID( "FStl" ), charIDToTypeID( strokePosCharID ) );

    fxPropDesc.putEnumerated(  charIDToTypeID( "PntT" ),  charIDToTypeID( "FrFl" ), charIDToTypeID( "SClr" ) );

    fxPropDesc.putEnumerated( charIDToTypeID( "Md  " ), charIDToTypeID( "BlnM" ), charIDToTypeID( "Nrml" ) );

    fxPropDesc.putUnitDouble( charIDToTypeID( "Opct" ), charIDToTypeID( "#Prc" ), opacity );

    fxPropDesc.putUnitDouble( charIDToTypeID( "Sz  " ), charIDToTypeID( "#Pxl") , size );

    var colorDesc = new ActionDescriptor();

    colorDesc.putDouble( charIDToTypeID( "Rd  " ), color.red);

    colorDesc.putDouble( charIDToTypeID( "Grn " ), color.green );

    colorDesc.putDouble( charIDToTypeID( "Bl  " ), color.blue );

    fxPropDesc.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), colorDesc );

    fxPropDesc.putBoolean( stringIDToTypeID( "overprint" ), false );

    fxDesc.putObject( charIDToTypeID( "FrFX" ), charIDToTypeID( "FrFX" ), fxPropDesc );

    desc.putObject( charIDToTypeID( "T   " ), charIDToTypeID( "Lefx" ), fxDesc );

    executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );

}

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
Engaged ,
Nov 06, 2016 Nov 06, 2016

Thank you so much, that works wonderfully.  My script is able to use the code you provided with no issues whatsoever.  I appreciate it!

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
Participant ,
Jul 09, 2021 Jul 09, 2021

In this script I want to add stoke in multiple layer when select the layer ?

 

function addStroke(size, color, opacity, position) {

var strokePosCharID;

 

switch(position) {

case 'center':

strokePosCharID = 'CtrF';

break;

case 'outside':

strokePosCharID = 'OutF';

break;

case 'inside':

strokePosCharID = 'InsF';

break;

default: break;

}

 

var desc = new ActionDescriptor();

var ref190 = new ActionReference();

 

ref190.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "Lefx" ) );

ref190.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

desc.putReference( charIDToTypeID( "null" ), ref190 );

var fxDesc = new ActionDescriptor();

 

var fxPropDesc = new ActionDescriptor();

fxPropDesc.putBoolean( charIDToTypeID( "enab" ), true );

fxPropDesc.putBoolean( stringIDToTypeID( "present" ), true );

fxPropDesc.putBoolean( stringIDToTypeID( "showInDialog" ), true );

fxPropDesc.putEnumerated( charIDToTypeID( "Styl" ), charIDToTypeID( "FStl" ), charIDToTypeID( strokePosCharID ) );

fxPropDesc.putEnumerated( charIDToTypeID( "PntT" ), charIDToTypeID( "FrFl" ), charIDToTypeID( "SClr" ) );

fxPropDesc.putEnumerated( charIDToTypeID( "Md " ), charIDToTypeID( "BlnM" ), charIDToTypeID( "Nrml" ) );

fxPropDesc.putUnitDouble( charIDToTypeID( "Opct" ), charIDToTypeID( "#Prc" ), opacity );

fxPropDesc.putUnitDouble( charIDToTypeID( "Sz " ), charIDToTypeID( "#Pxl") , size );

var colorDesc = new ActionDescriptor();

colorDesc.putDouble( charIDToTypeID( "Rd " ), color.red);

colorDesc.putDouble( charIDToTypeID( "Grn " ), color.green );

colorDesc.putDouble( charIDToTypeID( "Bl " ), color.blue );

fxPropDesc.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), colorDesc );

fxPropDesc.putBoolean( stringIDToTypeID( "overprint" ), false );

fxDesc.putObject( charIDToTypeID( "FrFX" ), charIDToTypeID( "FrFX" ), fxPropDesc );

desc.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Lefx" ), fxDesc );

executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );

}

 

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
LEGEND ,
Jul 09, 2021 Jul 09, 2021

Don't create new topics for existing threads. Just continue current one if there's no difference between original code and yours, copied from. Use always </> icon (with JAVASCRIPT label) when pasting the code otherwise you risk some double / triple spaces will be shrinked to just one. You were rebuked not once on this forum, so learn to comply with rules, or at least given tips. Don't repeat constantly the same questions when others ask you what you exaclty want, but respect them bringing constructive answers.

 

The problem with your code is Action Manager characters don't have sufficient spaces.

"Md ", "Sz ", "Rd ", "Bl " and "T " are too short. There is also lack of starting code:

 

var strokeColor = new RGBColor();
strokeColor.hexValue = '000000';
addStroke(1, strokeColor, 100, 'inside');

 

 Simply copy full code originally posted in this thread and change addStroke function values to desired.

 

Once again, if you're going to ignore ACP's and moderators who take care of this (forum) section and its users by conducting everyone to smoothly gain their goal you may meet unnecessary problems. THX 🙂

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
Participant ,
Jul 09, 2021 Jul 09, 2021

I want to Selected Layer, Like Layer 1,Layer 2

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
Participant ,
Jul 09, 2021 Jul 09, 2021

Multiple Layer Selected Getting a Error

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
LEGEND ,
Jul 09, 2021 Jul 09, 2021

After using above script on one layer find the script on this forum which:

'Copy Layer Style', select all other document layers and 'Paste Layer Style.'

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
Participant ,
Jul 09, 2021 Jul 09, 2021

Can your provide sricpt 

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
LEGEND ,
Jul 09, 2021 Jul 09, 2021

'Search this community' (on top of page) can provide it for you, just use proper keywords 😉

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
Participant ,
Jul 09, 2021 Jul 09, 2021

Did not found it

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
LEGEND ,
Jul 09, 2021 Jul 09, 2021

Then use ScriptingListener plug-in, by which you can record to a file your manual doings.

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
Participant ,
Jul 09, 2021 Jul 09, 2021

In this script Add Stoke Selected Layer Like Layer 1,Layer2, Layer 3,Layer 4 etc.

This script stoke apply only one layer, not these selected Layer

 

 

// Add Stroke to layer
var strokeColor = new RGBColor();

strokeColor.hexValue = '000000';

addStroke(10, strokeColor, 100, 'inside');

/*

* Add Stroke Effect

* @Param {Number} size : 1 - 250

* @Param {Object} color : RGBColor object

* @Param {Number} opacity : 0 - 100

* @Param {Number} position : center / outside / inside

*/

function addStroke(size, color, opacity, position) {

var strokePosCharID;

 

switch(position) {

case 'center':

strokePosCharID = 'CtrF';

break;

case 'outside':

strokePosCharID = 'OutF';

break;

case 'inside':

strokePosCharID = 'InsF';

break;

default: break;

}

 

var desc = new ActionDescriptor();

var ref190 = new ActionReference();

 

ref190.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "Lefx" ) );

ref190.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

desc.putReference( charIDToTypeID( "null" ), ref190 );

var fxDesc = new ActionDescriptor();

 

var fxPropDesc = new ActionDescriptor();

fxPropDesc.putBoolean( charIDToTypeID( "enab" ), true );

fxPropDesc.putBoolean( stringIDToTypeID( "present" ), true );

fxPropDesc.putBoolean( stringIDToTypeID( "showInDialog" ), true );

fxPropDesc.putEnumerated( charIDToTypeID( "Styl" ), charIDToTypeID( "FStl" ), charIDToTypeID( strokePosCharID ) );

fxPropDesc.putEnumerated( charIDToTypeID( "PntT" ), charIDToTypeID( "FrFl" ), charIDToTypeID( "SClr" ) );

fxPropDesc.putEnumerated( charIDToTypeID( "Md " ), charIDToTypeID( "BlnM" ), charIDToTypeID( "Nrml" ) );

fxPropDesc.putUnitDouble( charIDToTypeID( "Opct" ), charIDToTypeID( "#Prc" ), opacity );

fxPropDesc.putUnitDouble( charIDToTypeID( "Sz " ), charIDToTypeID( "#Pxl") , size );

var colorDesc = new ActionDescriptor();

colorDesc.putDouble( charIDToTypeID( "Rd " ), color.red);

colorDesc.putDouble( charIDToTypeID( "Grn " ), color.green );

colorDesc.putDouble( charIDToTypeID( "Bl " ), color.blue );

fxPropDesc.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), colorDesc );

fxPropDesc.putBoolean( stringIDToTypeID( "overprint" ), false );

fxDesc.putObject( charIDToTypeID( "FrFX" ), charIDToTypeID( "FrFX" ), fxPropDesc );

desc.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Lefx" ), fxDesc );

executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );

}

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
Participant ,
Jul 09, 2021 Jul 09, 2021

How to use ScriptingListner plugins !

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
LEGEND ,
Jul 09, 2021 Jul 09, 2021

There's description how to use it on a linked page. Don't ask of something that's available.

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
Community Expert ,
Jul 09, 2021 Jul 09, 2021

What is the issue that you're having?

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
Participant ,
Jul 09, 2021 Jul 09, 2021

Not a issue I want add stoke in Selected Layer in Script,

How to add Stoke Selected Layer

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
Community Expert ,
Jul 09, 2021 Jul 09, 2021

Please provide a meaningful description. 

What kind of Stroke are you talking about? A Shape Layer Stroke or the Layer Style Stroke?  

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
Participant ,
Jul 09, 2021 Jul 09, 2021

Layer Style Stoke

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
Community Expert ,
Jul 09, 2021 Jul 09, 2021

I know it has no bearing on the actual issue but why do you keep writing »Stoke« instead of »Stroke«? 

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
Participant ,
Jul 09, 2021 Jul 09, 2021

This script i want to selected layer stoke

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
Community Expert ,
Jul 09, 2021 Jul 09, 2021

You can not select pixels that do not exist in layers. Layer Style Strokes do not exist in any layer they are rendered on the document composite image.  Here do you see any red pixels in the layers thumbnails in the layers palette.  I can select the Gray Pixels even the ones hidden by the stroke.  I can select the White pixels even the one hidden under the late style Stroke.  I actually clicked in the Red stroke to select the white pixels a and the gray pixels shown here.

Capture.jpg

 

You would need to rasterize the layer style first. You would no longer have a smart object layer with a layer style you would  have a raster layers without a layer style.

Capture.jpg

 

JJMack
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
Participant ,
Jul 09, 2021 Jul 09, 2021

In this script working fine by one laye but i want to add multiple layer on stoke,

 

// Add Stroke to layer

 


var strokeColor = new RGBColor();
strokeColor.hexValue = '000000';
addStroke(10, strokeColor, 100, 'inside');

/*

* Add Stroke Effect

* @Param {Number} size : 1 - 250

* @Param {Object} color : RGBColor object

* @Param {Number} opacity : 0 - 100

* @Param {Number} position : center / outside / inside

*/

function addStroke(size, color, opacity, position) {

var strokePosCharID;

 

switch(position) {

case 'center':

strokePosCharID = 'CtrF';

break;

case 'outside':

strokePosCharID = 'OutF';

break;

case 'inside':

strokePosCharID = 'InsF';

break;

default: break;

}

 

var desc = new ActionDescriptor();

var ref190 = new ActionReference();

 

ref190.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "Lefx" ) );

ref190.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

desc.putReference( charIDToTypeID( "null" ), ref190 );

var fxDesc = new ActionDescriptor();

 

var fxPropDesc = new ActionDescriptor();

fxPropDesc.putBoolean( charIDToTypeID( "enab" ), true );

fxPropDesc.putBoolean( stringIDToTypeID( "present" ), true );

fxPropDesc.putBoolean( stringIDToTypeID( "showInDialog" ), true );

fxPropDesc.putEnumerated( charIDToTypeID( "Styl" ), charIDToTypeID( "FStl" ), charIDToTypeID( strokePosCharID ) );

fxPropDesc.putEnumerated( charIDToTypeID( "PntT" ), charIDToTypeID( "FrFl" ), charIDToTypeID( "SClr" ) );

fxPropDesc.putEnumerated( charIDToTypeID( "Md " ), charIDToTypeID( "BlnM" ), charIDToTypeID( "Nrml" ) );

fxPropDesc.putUnitDouble( charIDToTypeID( "Opct" ), charIDToTypeID( "#Prc" ), opacity );

fxPropDesc.putUnitDouble( charIDToTypeID( "Sz " ), charIDToTypeID( "#Pxl") , size );

var colorDesc = new ActionDescriptor();

colorDesc.putDouble( charIDToTypeID( "Rd " ), color.red);

colorDesc.putDouble( charIDToTypeID( "Grn " ), color.green );

colorDesc.putDouble( charIDToTypeID( "Bl " ), color.blue );

fxPropDesc.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), colorDesc );

fxPropDesc.putBoolean( stringIDToTypeID( "overprint" ), false );

fxDesc.putObject( charIDToTypeID( "FrFX" ), charIDToTypeID( "FrFX" ), fxPropDesc );

desc.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Lefx" ), fxDesc );

executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );

}

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