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

Parametrising an internal border

Community Beginner ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

In the absence of trying to create a "border" line to an image in light room where the border is actually just inside the edge of the image that apparently, according to another forum post can't be done, is there a way to parameterise this as an action in PS.

 

so instead of having to go through the process manually each time for images of variable dimensions it will look at the image height and width and instead of committing to xpixels it will do x%.

 

so if an image is 3000x4000 then the line is say 30 pixels wide and positioned 100 pixels inside the outer edge whilst if the image is 300x400 it sets this to 3 pixels wide and 10 pixels inside the outer edge?

Views

113

Translate

Translate

Report

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
Adobe
Community Expert ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

Moderator- Please transfer this post to the 'Photoshop' Community forum.

Regards. My System: Lightroom-Classic 13.2 Photoshop 25.5, ACR 16.2, Lightroom 7.2, Lr-iOS 9.0.1, Bridge 14.0.2, Windows-11.

Votes

Translate

Translate

Report

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 ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

I suspect this would need a Script instead of an Action. 

Votes

Translate

Translate

Report

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 Beginner ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

Do you know where I can find some script guide that might come close to this that I can adopt?

Votes

Translate

Translate

Report

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 ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

LATEST

 

// 2021, use it at your own risk;
if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
// set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
// get dimensions;
    var theWidth = myDocument.width;
    var theHeight = myDocument.height;
    var theOffset = theWidth*0.0333333;
    var theStroke = theWidth*0.01;
    myDocument.selection.select([[theOffset, theOffset], [theWidth-theOffset, theOffset], [theWidth-theOffset, theHeight-theOffset], [theOffset, theHeight-theOffset]], SelectionType.REPLACE, 0, false)
    myDocument.selection.select([[theOffset+theStroke, theOffset+theStroke], [theWidth-theOffset-theStroke, theOffset+theStroke], [theWidth-theOffset-theStroke, theHeight-theOffset-theStroke], [theOffset+theStroke, theHeight-theOffset-theStroke]], SelectionType.DIMINISH, 0, false)
    createSolidColorLayer (0, 0, 0);
// reset;
    app.preferences.rulerUnits = originalRulerUnits;
};
////// make solid color layer //////
function createSolidColorLayer (theRed, theGreen, theBlue) {
// create solid color layer;
// =======================================================
    var idMk = charIDToTypeID( "Mk  " );
        var desc8 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref6 = new ActionReference();
            var idcontentLayer = stringIDToTypeID( "contentLayer" );
            ref6.putClass( idcontentLayer );
        desc8.putReference( idnull, ref6 );
        var idUsng = charIDToTypeID( "Usng" );
            var desc9 = new ActionDescriptor();
            var idType = charIDToTypeID( "Type" );
                var desc10 = new ActionDescriptor();
                var idClr = charIDToTypeID( "Clr " );
                    var desc11 = new ActionDescriptor();
                    var idRd = charIDToTypeID( "Rd  " );
                    desc11.putDouble( idRd, theRed );
                    var idGrn = charIDToTypeID( "Grn " );
                    desc11.putDouble( idGrn, theGreen );
                    var idBl = charIDToTypeID( "Bl  " );
                    desc11.putDouble( idBl, theBlue );
                var idRGBC = charIDToTypeID( "RGBC" );
                desc10.putObject( idClr, idRGBC, desc11 );
            var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
            desc9.putObject( idType, idsolidColorLayer, desc10 );
        var idcontentLayer = stringIDToTypeID( "contentLayer" );
        desc8.putObject( idUsng, idcontentLayer, desc9 );
    executeAction( idMk, desc8, DialogModes.NO );
    return activeDocument.activeLayer
    };

 

Votes

Translate

Translate

Report

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