Skip to main content
mysysctrlm74982608
Known Participant
October 28, 2022
Answered

Hey guys, how to convert PS guides into paths or strokes?

  • October 28, 2022
  • 4 replies
  • 11345 views

I created a guide layout but I need it in the visible form of a path or stroke, how to convert it, thanks.

This topic has been closed for replies.
Correct answer Chuck Uebele

Here's a script that will break all the vertical lines at the gutters.

 

#target photoshop 
var lineWidth = 6
var userColor = false;

if(userColor){
    app.showColorPicker()
    }

var cRed = foregroundColor.rgb.red;
var cGreen = foregroundColor.rgb.green;
var cBlue = foregroundColor.rgb.blue;

app.preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument
var g = doc.guides
var vertG = []
var horG = []
var coord = new Array();

for (i=0;i<g.length;i++){
    if(g[i].direction == 'Direction.HORIZONTAL'){horG.push (g[i].coordinate.value)}
    else{vertG.push (g[i].coordinate.value)}
    };
horG.sort (function(a, b){return a - b});
var minV=horG[1]-horG[0];
for(i=0;i<horG.length-1;i++){
    var newV = horG[i+1]-horG[i];
    minV = Math.min(newV,minV)
    }

for(var i=0;i<horG.length+1;i++){// make lines for hor guides full doc width
    try{
        makeLine (horG[i]-lineWidth/2, 0, horG[i]+lineWidth/2, doc.width)   
    }
    catch(e){};
    var cA = [horG[i],horG[i+1]];
    if(horG[i+1]-horG[i] != minV && horG[i+1] >-1){
        coord.push (cA)
        }
    }
for(var i=0;i<vertG.length;i++){
    for(var j=0;j<coord.length;j++){
       makeLine (coord[j][0], vertG[i]-lineWidth/2, coord[j][1], vertG[i]+lineWidth/2)
        }
    }




function makeLine(topS, leftS, bottomS, rightS ){
    
var idMk = charIDToTypeID( "Mk  " );
    var desc38 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref3 = new ActionReference();
        var idcontentLayer = stringIDToTypeID( "contentLayer" );
        ref3.putClass( idcontentLayer );
    desc38.putReference( idnull, ref3 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc39 = new ActionDescriptor();
        var idType = charIDToTypeID( "Type" );
            var desc40 = new ActionDescriptor();
            var idClr = charIDToTypeID( "Clr " );
                var desc41 = new ActionDescriptor();
                var idRd = charIDToTypeID( "Rd  " );
                desc41.putDouble( idRd, cRed );
                var idGrn = charIDToTypeID( "Grn " );
                desc41.putDouble( idGrn, cGreen );
                var idBl = charIDToTypeID( "Bl  " );
                desc41.putDouble( idBl, cBlue );
            var idRGBC = charIDToTypeID( "RGBC" );
            desc40.putObject( idClr, idRGBC, desc41 );
        var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
        desc39.putObject( idType, idsolidColorLayer, desc40 );
        var idShp = charIDToTypeID( "Shp " );
            var desc42 = new ActionDescriptor();
            var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
            desc42.putInteger( idunitValueQuadVersion, 1 );
            var idTop = charIDToTypeID( "Top " );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idTop, idPxl,topS);
            var idLeft = charIDToTypeID( "Left" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idLeft, idPxl, leftS );
            var idBtom = charIDToTypeID( "Btom" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idBtom, idPxl, bottomS );
            var idRght = charIDToTypeID( "Rght" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idRght, idPxl, rightS );
            var idtopRight = stringIDToTypeID( "topRight" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idtopRight, idPxl, 0.000000 );
            var idtopLeft = stringIDToTypeID( "topLeft" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idtopLeft, idPxl, 0.000000 );
            var idbottomLeft = stringIDToTypeID( "bottomLeft" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idbottomLeft, idPxl, 0.000000 );
            var idbottomRight = stringIDToTypeID( "bottomRight" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idbottomRight, idPxl, 0.000000 );
        var idRctn = charIDToTypeID( "Rctn" );
        desc39.putObject( idShp, idRctn, desc42 );
        var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
            var desc43 = new ActionDescriptor();
            var idstrokeStyleVersion = stringIDToTypeID( "strokeStyleVersion" );
            desc43.putInteger( idstrokeStyleVersion, 2 );
            var idstrokeEnabled = stringIDToTypeID( "strokeEnabled" );
            desc43.putBoolean( idstrokeEnabled, false );
            var idfillEnabled = stringIDToTypeID( "fillEnabled" );
            desc43.putBoolean( idfillEnabled, true );
            var idstrokeStyleLineWidth = stringIDToTypeID( "strokeStyleLineWidth" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc43.putUnitDouble( idstrokeStyleLineWidth, idPxl, 1.000000 );
            var idstrokeStyleLineDashOffset = stringIDToTypeID( "strokeStyleLineDashOffset" );
            var idPnt = charIDToTypeID( "#Pnt" );
            desc43.putUnitDouble( idstrokeStyleLineDashOffset, idPnt, 0.000000 );
            var idstrokeStyleMiterLimit = stringIDToTypeID( "strokeStyleMiterLimit" );
            desc43.putDouble( idstrokeStyleMiterLimit, 100.000000 );
            var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
            var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
            var idstrokeStyleButtCap = stringIDToTypeID( "strokeStyleButtCap" );
            desc43.putEnumerated( idstrokeStyleLineCapType, idstrokeStyleLineCapType, idstrokeStyleButtCap );
            var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
            var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
            var idstrokeStyleMiterJoin = stringIDToTypeID( "strokeStyleMiterJoin" );
            desc43.putEnumerated( idstrokeStyleLineJoinType, idstrokeStyleLineJoinType, idstrokeStyleMiterJoin );
            var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
            var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
            var idstrokeStyleAlignCenter = stringIDToTypeID( "strokeStyleAlignCenter" );
            desc43.putEnumerated( idstrokeStyleLineAlignment, idstrokeStyleLineAlignment, idstrokeStyleAlignCenter );
            var idstrokeStyleScaleLock = stringIDToTypeID( "strokeStyleScaleLock" );
            desc43.putBoolean( idstrokeStyleScaleLock, false );
            var idstrokeStyleStrokeAdjust = stringIDToTypeID( "strokeStyleStrokeAdjust" );
            desc43.putBoolean( idstrokeStyleStrokeAdjust, false );
            var idstrokeStyleLineDashSet = stringIDToTypeID( "strokeStyleLineDashSet" );
                var list3 = new ActionList();
            desc43.putList( idstrokeStyleLineDashSet, list3 );
            var idstrokeStyleBlendMode = stringIDToTypeID( "strokeStyleBlendMode" );
            var idBlnM = charIDToTypeID( "BlnM" );
            var idNrml = charIDToTypeID( "Nrml" );
            desc43.putEnumerated( idstrokeStyleBlendMode, idBlnM, idNrml );
            var idstrokeStyleOpacity = stringIDToTypeID( "strokeStyleOpacity" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc43.putUnitDouble( idstrokeStyleOpacity, idPrc, 100.000000 );
            var idstrokeStyleContent = stringIDToTypeID( "strokeStyleContent" );
                var desc44 = new ActionDescriptor();
                var idClr = charIDToTypeID( "Clr " );
                    var desc45 = new ActionDescriptor();
                    var idRd = charIDToTypeID( "Rd  " );
                    desc45.putDouble( idRd, cRed );
                    var idGrn = charIDToTypeID( "Grn " );
                    desc45.putDouble( idGrn, cGreen );
                    var idBl = charIDToTypeID( "Bl  " );
                    desc45.putDouble( idBl, cBlue );
                var idRGBC = charIDToTypeID( "RGBC" );
                desc44.putObject( idClr, idRGBC, desc45 );
            var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
            desc43.putObject( idstrokeStyleContent, idsolidColorLayer, desc44 );
            var idstrokeStyleResolution = stringIDToTypeID( "strokeStyleResolution" );
            desc43.putDouble( idstrokeStyleResolution, 300.000000 );
        var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
        desc39.putObject( idstrokeStyle, idstrokeStyle, desc43 );
    var idcontentLayer = stringIDToTypeID( "contentLayer" );
    desc38.putObject( idUsng, idcontentLayer, desc39 );
    var idLyrI = charIDToTypeID( "LyrI" );
    desc38.putInteger( idLyrI, 28 );
executeAction( idMk, desc38, DialogModes.NO );
    }

 

4 replies

Chuck Uebele
Community Expert
Chuck UebeleCommunity ExpertCorrect answer
Community Expert
October 29, 2022

Here's a script that will break all the vertical lines at the gutters.

 

#target photoshop 
var lineWidth = 6
var userColor = false;

if(userColor){
    app.showColorPicker()
    }

var cRed = foregroundColor.rgb.red;
var cGreen = foregroundColor.rgb.green;
var cBlue = foregroundColor.rgb.blue;

app.preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument
var g = doc.guides
var vertG = []
var horG = []
var coord = new Array();

for (i=0;i<g.length;i++){
    if(g[i].direction == 'Direction.HORIZONTAL'){horG.push (g[i].coordinate.value)}
    else{vertG.push (g[i].coordinate.value)}
    };
horG.sort (function(a, b){return a - b});
var minV=horG[1]-horG[0];
for(i=0;i<horG.length-1;i++){
    var newV = horG[i+1]-horG[i];
    minV = Math.min(newV,minV)
    }

for(var i=0;i<horG.length+1;i++){// make lines for hor guides full doc width
    try{
        makeLine (horG[i]-lineWidth/2, 0, horG[i]+lineWidth/2, doc.width)   
    }
    catch(e){};
    var cA = [horG[i],horG[i+1]];
    if(horG[i+1]-horG[i] != minV && horG[i+1] >-1){
        coord.push (cA)
        }
    }
for(var i=0;i<vertG.length;i++){
    for(var j=0;j<coord.length;j++){
       makeLine (coord[j][0], vertG[i]-lineWidth/2, coord[j][1], vertG[i]+lineWidth/2)
        }
    }




function makeLine(topS, leftS, bottomS, rightS ){
    
var idMk = charIDToTypeID( "Mk  " );
    var desc38 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref3 = new ActionReference();
        var idcontentLayer = stringIDToTypeID( "contentLayer" );
        ref3.putClass( idcontentLayer );
    desc38.putReference( idnull, ref3 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc39 = new ActionDescriptor();
        var idType = charIDToTypeID( "Type" );
            var desc40 = new ActionDescriptor();
            var idClr = charIDToTypeID( "Clr " );
                var desc41 = new ActionDescriptor();
                var idRd = charIDToTypeID( "Rd  " );
                desc41.putDouble( idRd, cRed );
                var idGrn = charIDToTypeID( "Grn " );
                desc41.putDouble( idGrn, cGreen );
                var idBl = charIDToTypeID( "Bl  " );
                desc41.putDouble( idBl, cBlue );
            var idRGBC = charIDToTypeID( "RGBC" );
            desc40.putObject( idClr, idRGBC, desc41 );
        var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
        desc39.putObject( idType, idsolidColorLayer, desc40 );
        var idShp = charIDToTypeID( "Shp " );
            var desc42 = new ActionDescriptor();
            var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
            desc42.putInteger( idunitValueQuadVersion, 1 );
            var idTop = charIDToTypeID( "Top " );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idTop, idPxl,topS);
            var idLeft = charIDToTypeID( "Left" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idLeft, idPxl, leftS );
            var idBtom = charIDToTypeID( "Btom" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idBtom, idPxl, bottomS );
            var idRght = charIDToTypeID( "Rght" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idRght, idPxl, rightS );
            var idtopRight = stringIDToTypeID( "topRight" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idtopRight, idPxl, 0.000000 );
            var idtopLeft = stringIDToTypeID( "topLeft" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idtopLeft, idPxl, 0.000000 );
            var idbottomLeft = stringIDToTypeID( "bottomLeft" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idbottomLeft, idPxl, 0.000000 );
            var idbottomRight = stringIDToTypeID( "bottomRight" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idbottomRight, idPxl, 0.000000 );
        var idRctn = charIDToTypeID( "Rctn" );
        desc39.putObject( idShp, idRctn, desc42 );
        var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
            var desc43 = new ActionDescriptor();
            var idstrokeStyleVersion = stringIDToTypeID( "strokeStyleVersion" );
            desc43.putInteger( idstrokeStyleVersion, 2 );
            var idstrokeEnabled = stringIDToTypeID( "strokeEnabled" );
            desc43.putBoolean( idstrokeEnabled, false );
            var idfillEnabled = stringIDToTypeID( "fillEnabled" );
            desc43.putBoolean( idfillEnabled, true );
            var idstrokeStyleLineWidth = stringIDToTypeID( "strokeStyleLineWidth" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc43.putUnitDouble( idstrokeStyleLineWidth, idPxl, 1.000000 );
            var idstrokeStyleLineDashOffset = stringIDToTypeID( "strokeStyleLineDashOffset" );
            var idPnt = charIDToTypeID( "#Pnt" );
            desc43.putUnitDouble( idstrokeStyleLineDashOffset, idPnt, 0.000000 );
            var idstrokeStyleMiterLimit = stringIDToTypeID( "strokeStyleMiterLimit" );
            desc43.putDouble( idstrokeStyleMiterLimit, 100.000000 );
            var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
            var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
            var idstrokeStyleButtCap = stringIDToTypeID( "strokeStyleButtCap" );
            desc43.putEnumerated( idstrokeStyleLineCapType, idstrokeStyleLineCapType, idstrokeStyleButtCap );
            var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
            var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
            var idstrokeStyleMiterJoin = stringIDToTypeID( "strokeStyleMiterJoin" );
            desc43.putEnumerated( idstrokeStyleLineJoinType, idstrokeStyleLineJoinType, idstrokeStyleMiterJoin );
            var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
            var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
            var idstrokeStyleAlignCenter = stringIDToTypeID( "strokeStyleAlignCenter" );
            desc43.putEnumerated( idstrokeStyleLineAlignment, idstrokeStyleLineAlignment, idstrokeStyleAlignCenter );
            var idstrokeStyleScaleLock = stringIDToTypeID( "strokeStyleScaleLock" );
            desc43.putBoolean( idstrokeStyleScaleLock, false );
            var idstrokeStyleStrokeAdjust = stringIDToTypeID( "strokeStyleStrokeAdjust" );
            desc43.putBoolean( idstrokeStyleStrokeAdjust, false );
            var idstrokeStyleLineDashSet = stringIDToTypeID( "strokeStyleLineDashSet" );
                var list3 = new ActionList();
            desc43.putList( idstrokeStyleLineDashSet, list3 );
            var idstrokeStyleBlendMode = stringIDToTypeID( "strokeStyleBlendMode" );
            var idBlnM = charIDToTypeID( "BlnM" );
            var idNrml = charIDToTypeID( "Nrml" );
            desc43.putEnumerated( idstrokeStyleBlendMode, idBlnM, idNrml );
            var idstrokeStyleOpacity = stringIDToTypeID( "strokeStyleOpacity" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc43.putUnitDouble( idstrokeStyleOpacity, idPrc, 100.000000 );
            var idstrokeStyleContent = stringIDToTypeID( "strokeStyleContent" );
                var desc44 = new ActionDescriptor();
                var idClr = charIDToTypeID( "Clr " );
                    var desc45 = new ActionDescriptor();
                    var idRd = charIDToTypeID( "Rd  " );
                    desc45.putDouble( idRd, cRed );
                    var idGrn = charIDToTypeID( "Grn " );
                    desc45.putDouble( idGrn, cGreen );
                    var idBl = charIDToTypeID( "Bl  " );
                    desc45.putDouble( idBl, cBlue );
                var idRGBC = charIDToTypeID( "RGBC" );
                desc44.putObject( idClr, idRGBC, desc45 );
            var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
            desc43.putObject( idstrokeStyleContent, idsolidColorLayer, desc44 );
            var idstrokeStyleResolution = stringIDToTypeID( "strokeStyleResolution" );
            desc43.putDouble( idstrokeStyleResolution, 300.000000 );
        var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
        desc39.putObject( idstrokeStyle, idstrokeStyle, desc43 );
    var idcontentLayer = stringIDToTypeID( "contentLayer" );
    desc38.putObject( idUsng, idcontentLayer, desc39 );
    var idLyrI = charIDToTypeID( "LyrI" );
    desc38.putInteger( idLyrI, 28 );
executeAction( idMk, desc38, DialogModes.NO );
    }

 

mysysctrlm74982608
Known Participant
October 30, 2022

I am a little greedy, can the different direction lines be grouped in different folders in order to batch organize?

mysysctrlm74982608
Known Participant
November 1, 2022

I will have to make changes to have the overflow work. Here is what I have for a single file.

 

 

 

#target photoshop 
var doc = activeDocument
app.preferences.rulerUnits = Units.POINTS;
var docG = doc.guides
var gH = []
var gV = []
var squaresV = []
var defaultValue = '';
var str = prompt("Enter text to place in squares", defaultValue);
var exitLoop = false;

//alert(str.substr (45, 1)=='')
for (var i=0;i<docG.length;i++){
    if(docG[i].direction == 'Direction.HORIZONTAL' && (docG[i].coordinate.value !=0 && docG[i].coordinate.value !=doc.height.value)){
        gH.push(docG[i].coordinate.value)
        }
    else if(docG[i].coordinate !=0 && docG[i].coordinate.value !=doc.width.value){gV.push(docG[i].coordinate.value)}

    }
gH.sort (function(a, b){return a - b});
gV.sort (function(a, b){return a - b});

var minV=gH[1]-gH[0];

for(var i=0;i<gH.length-1;i++){//get the gutter size - min dimension
    var newV = gH[i+1]-gH[i];
    minV = Math.min(minV,newV)
    }

for(var i=0;i<gH.length-1;i++){//put the start and stop coordinates of the vertical distance for the spaces
    if(gH[i+1]-gH[i] != minV){
        squaresV.push([gH[i],gH[i+1]])
        }
    }

var textLay = doc.artLayers.add();//make a text layer and measure the text to get the center to baseline distance
textLay.kind = LayerKind.TEXT;
var textItemRef = textLay.textItem;
textItemRef.justification = Justification.CENTER;
textItemRef.contents = str

var textCaps = textLay.bounds
var textH = textCaps[1].value
var textB =  textCaps[3].value
var textVertCenter = (textB+textH)/2
var textOffset = textItemRef.position[1].value-textVertCenter    
textLay.remove();
var count = 0;

for(var i=0;i<squaresV.length;i++){
    if(exitLoop){break;}
    var tS = squaresV[i][0];
    var bS = squaresV[i][1];
    var tCenterV = (tS+bS)/2;
    var tBase = tCenterV+textOffset;
    
    for(var j=0;j<gV.length-1;j++){  
        if(str.substr (count, 1)==''){
            exitLoop = true;
            break;
            }
        var lS = gV[j];
        var rS = gV[j+1];
        var tCenterH = (lS+rS)/2
        
        textLay = doc.artLayers.add();//make a text layer and measure the text to get the center to baseline distance
        textLay.kind = LayerKind.TEXT;
        var textItemRef = textLay.textItem;
        textItemRef.justification = Justification.CENTER;       
        textItemRef.contents = str.substr (count, 1);
        textItemRef.position = [tCenterH,tBase]
        count++;        
        }
    }
 

 

 


1. If the text is too long, it will get stuck. 2. Each word is a separate text box. Can you write all the text in one text box? 3. The numbers should be more compact. 4. The text is written in the gutter when the line is changed. 5. The second insertion script does not start from the end of the last text, but starts over again

Chuck Uebele
Community Expert
Community Expert
October 28, 2022

Try this script. It will draw a rectangle shape around the guide. Change the line width to what you want. It will center the shape on the guide.

 

#target photoshop 
var lineWidth = 6
app.preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument
var g = doc.guides

for(var i=0;i<g.length;i++){
    var loc = g[i].coordinate.value

    if(g[i].direction == 'Direction.HORIZONTAL'){
        makeLine (loc-lineWidth/2, 0, loc+lineWidth/2, doc.width)        
        }
    else{
        makeLine (0, loc-lineWidth/2, doc.height, loc+lineWidth/2)
        }
    }

function makeLine(topS, leftS, bottomS, rightS ){
    
var idMk = charIDToTypeID( "Mk  " );
    var desc38 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref3 = new ActionReference();
        var idcontentLayer = stringIDToTypeID( "contentLayer" );
        ref3.putClass( idcontentLayer );
    desc38.putReference( idnull, ref3 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc39 = new ActionDescriptor();
        var idType = charIDToTypeID( "Type" );
            var desc40 = new ActionDescriptor();
            var idClr = charIDToTypeID( "Clr " );
                var desc41 = new ActionDescriptor();
                var idRd = charIDToTypeID( "Rd  " );
                desc41.putDouble( idRd, 0.000000 );
                var idGrn = charIDToTypeID( "Grn " );
                desc41.putDouble( idGrn, 0.000000 );
                var idBl = charIDToTypeID( "Bl  " );
                desc41.putDouble( idBl, 0.000000 );
            var idRGBC = charIDToTypeID( "RGBC" );
            desc40.putObject( idClr, idRGBC, desc41 );
        var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
        desc39.putObject( idType, idsolidColorLayer, desc40 );
        var idShp = charIDToTypeID( "Shp " );
            var desc42 = new ActionDescriptor();
            var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
            desc42.putInteger( idunitValueQuadVersion, 1 );
            var idTop = charIDToTypeID( "Top " );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idTop, idPxl,topS);
            var idLeft = charIDToTypeID( "Left" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idLeft, idPxl, leftS );
            var idBtom = charIDToTypeID( "Btom" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idBtom, idPxl, bottomS );
            var idRght = charIDToTypeID( "Rght" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idRght, idPxl, rightS );
            var idtopRight = stringIDToTypeID( "topRight" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idtopRight, idPxl, 0.000000 );
            var idtopLeft = stringIDToTypeID( "topLeft" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idtopLeft, idPxl, 0.000000 );
            var idbottomLeft = stringIDToTypeID( "bottomLeft" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idbottomLeft, idPxl, 0.000000 );
            var idbottomRight = stringIDToTypeID( "bottomRight" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc42.putUnitDouble( idbottomRight, idPxl, 0.000000 );
        var idRctn = charIDToTypeID( "Rctn" );
        desc39.putObject( idShp, idRctn, desc42 );
        var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
            var desc43 = new ActionDescriptor();
            var idstrokeStyleVersion = stringIDToTypeID( "strokeStyleVersion" );
            desc43.putInteger( idstrokeStyleVersion, 2 );
            var idstrokeEnabled = stringIDToTypeID( "strokeEnabled" );
            desc43.putBoolean( idstrokeEnabled, false );
            var idfillEnabled = stringIDToTypeID( "fillEnabled" );
            desc43.putBoolean( idfillEnabled, true );
            var idstrokeStyleLineWidth = stringIDToTypeID( "strokeStyleLineWidth" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc43.putUnitDouble( idstrokeStyleLineWidth, idPxl, 1.000000 );
            var idstrokeStyleLineDashOffset = stringIDToTypeID( "strokeStyleLineDashOffset" );
            var idPnt = charIDToTypeID( "#Pnt" );
            desc43.putUnitDouble( idstrokeStyleLineDashOffset, idPnt, 0.000000 );
            var idstrokeStyleMiterLimit = stringIDToTypeID( "strokeStyleMiterLimit" );
            desc43.putDouble( idstrokeStyleMiterLimit, 100.000000 );
            var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
            var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
            var idstrokeStyleButtCap = stringIDToTypeID( "strokeStyleButtCap" );
            desc43.putEnumerated( idstrokeStyleLineCapType, idstrokeStyleLineCapType, idstrokeStyleButtCap );
            var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
            var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
            var idstrokeStyleMiterJoin = stringIDToTypeID( "strokeStyleMiterJoin" );
            desc43.putEnumerated( idstrokeStyleLineJoinType, idstrokeStyleLineJoinType, idstrokeStyleMiterJoin );
            var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
            var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
            var idstrokeStyleAlignCenter = stringIDToTypeID( "strokeStyleAlignCenter" );
            desc43.putEnumerated( idstrokeStyleLineAlignment, idstrokeStyleLineAlignment, idstrokeStyleAlignCenter );
            var idstrokeStyleScaleLock = stringIDToTypeID( "strokeStyleScaleLock" );
            desc43.putBoolean( idstrokeStyleScaleLock, false );
            var idstrokeStyleStrokeAdjust = stringIDToTypeID( "strokeStyleStrokeAdjust" );
            desc43.putBoolean( idstrokeStyleStrokeAdjust, false );
            var idstrokeStyleLineDashSet = stringIDToTypeID( "strokeStyleLineDashSet" );
                var list3 = new ActionList();
            desc43.putList( idstrokeStyleLineDashSet, list3 );
            var idstrokeStyleBlendMode = stringIDToTypeID( "strokeStyleBlendMode" );
            var idBlnM = charIDToTypeID( "BlnM" );
            var idNrml = charIDToTypeID( "Nrml" );
            desc43.putEnumerated( idstrokeStyleBlendMode, idBlnM, idNrml );
            var idstrokeStyleOpacity = stringIDToTypeID( "strokeStyleOpacity" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc43.putUnitDouble( idstrokeStyleOpacity, idPrc, 100.000000 );
            var idstrokeStyleContent = stringIDToTypeID( "strokeStyleContent" );
                var desc44 = new ActionDescriptor();
                var idClr = charIDToTypeID( "Clr " );
                    var desc45 = new ActionDescriptor();
                    var idRd = charIDToTypeID( "Rd  " );
                    desc45.putDouble( idRd, 255.000000 );
                    var idGrn = charIDToTypeID( "Grn " );
                    desc45.putDouble( idGrn, 0.003891 );
                    var idBl = charIDToTypeID( "Bl  " );
                    desc45.putDouble( idBl, 0.003891 );
                var idRGBC = charIDToTypeID( "RGBC" );
                desc44.putObject( idClr, idRGBC, desc45 );
            var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
            desc43.putObject( idstrokeStyleContent, idsolidColorLayer, desc44 );
            var idstrokeStyleResolution = stringIDToTypeID( "strokeStyleResolution" );
            desc43.putDouble( idstrokeStyleResolution, 300.000000 );
        var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
        desc39.putObject( idstrokeStyle, idstrokeStyle, desc43 );
    var idcontentLayer = stringIDToTypeID( "contentLayer" );
    desc38.putObject( idUsng, idcontentLayer, desc39 );
    var idLyrI = charIDToTypeID( "LyrI" );
    desc38.putInteger( idLyrI, 28 );
executeAction( idMk, desc38, DialogModes.NO );
    }

 

mysysctrlm74982608
Known Participant
October 28, 2022

It wouldn't work, sorry.

Chuck Uebele
Community Expert
Community Expert
October 28, 2022

What happened? 

Bojan Živković11378569
Community Expert
Community Expert
October 28, 2022

There isn't built in option as far as I know.