Skip to main content
January 31, 2026
Question

How can I record a Sky Replacement action/script ?

  • January 31, 2026
  • 1 reply
  • 33 views

I do sky replacements, and I always use the same parameters. But I can’t get Photoshop to apply them, either batch, action, script, nothing works. It always defaults to the basic sky replacement values, and I have to tweak them one by one which is useless if I have may images to do. I’ve tried coding a Jsx file, still no luck, made a lot of tweaks, nothing. No idea why this issue persists. It’s a cool tool, but to be honest not being able to batch it is a HUGE let down. Any help is appreciated

// =======================================================
var idskyReplacement = stringIDToTypeID( "skyReplacement" );
    var desc = new ActionDescriptor();
    var idshiftEdge = stringIDToTypeID( "shiftEdge" );
    desc.putDouble( idshiftEdge, -0.200000 );
    var idborderSmoothness = stringIDToTypeID( "borderSmoothness" );
    desc.putInteger( idborderSmoothness, 70 );
    var idBrgh = charIDToTypeID( "Brgh" );
    desc.putInteger( idBrgh, 32 );
    var idtemperature = stringIDToTypeID( "temperature" );
    desc.putInteger( idtemperature, 14 );
    var idharmonizationOpacity = stringIDToTypeID( "harmonizationOpacity" );
    desc.putInteger( idharmonizationOpacity, 0 );
    var idforegroundLightingOpacity = stringIDToTypeID( "foregroundLightingOpacity" );
    desc.putInteger( idforegroundLightingOpacity, 0 );
    var idlightingMode = stringIDToTypeID( "lightingMode" );
    var idBlnM = charIDToTypeID( "BlnM" );
    var idScrn = charIDToTypeID( "Scrn" );
    desc.putEnumerated( idlightingMode, idBlnM, idScrn );
    var idedgeLightingOpacity = stringIDToTypeID( "edgeLightingOpacity" );
    desc.putInteger( idedgeLightingOpacity, 14 );
    var idskyReplacementOutput = stringIDToTypeID( "skyReplacementOutput" );
    var idskyReplacementOutput = stringIDToTypeID( "skyReplacementOutput" );
    var idskyReplacementOutputToDuplicateSheet = stringIDToTypeID( "skyReplacementOutputToDuplicateSheet" );
    desc.putEnumerated( idskyReplacementOutput, idskyReplacementOutput, idskyReplacementOutputToDuplicateSheet );
    var idIdnt = charIDToTypeID( "Idnt" );
    desc.putString( idIdnt, """d36f6769-1c16-f641-bac6-aff4f13fa601""" );
    var idNm = charIDToTypeID( "Nm " );
    desc.putString( idNm, """BlueSky001byPhotoshop""" );
    // var idFile = charIDToTypeID( "File" );
    // desc.putPath( idFile, new File( "C:\\Users\\USERNAME\\AppData\\Roaming\\Adobe\\Adobe Photoshop 2026\\Adobe Photoshop 2026 Settings\\Sky_Presets\\d36f6769-1c16-f641-bac6-aff4f13fa601.jpg" ) );
executeAction( idskyReplacement, desc, DialogModes.NO );

    1 reply

    Stephen Marsh
    Community Expert
    Community Expert
    January 31, 2026

    @yesnomaybe20251622 

     

    Please post a screenshot of the interface settings.

    January 31, 2026

    Sorry it’s in French. I manage to manually adjust (or disable) some settings when selecting output as “new layers” instead of output as “duplicate layer”, but the first two parameters (edge shift and border smoothness) I can’t touch, it always resets to default values. Can’t seem to be able to properly save any of those settings in a script, even when using ScriptingListenerJS