Photoshop's History Panel has options:
Which has the following options:
Is there a way to read / write those preferences using Photoshop Scripting / ExtendScript?
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityPhotoshop's History Panel has options:
Which has the following options:
Is there a way to read / write those preferences using Photoshop Scripting / ExtendScript?
Usually options like that are accessible via a deeper layer of Photoshop preferences: Action Descriptors. But I think the ones you mentioned aren't available even in it: I had the same problem trying to find a way to change Show Current Tool Only
in Tool Presets window. I tried to use xbytor's Getter script but it didn't register any changes when I was setting this option on and off. So I don't think this option is available for scripting unfortunately.
The following seems to work on Photoshop CC 2019:
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("layerVisibilityChangesAreUndoable"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
var d1 = new ActionDescriptor();
d1.putBoolean(stringIDToTypeID("layerVisibilityChangesAreUndoable"), false);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("layerVisibilityChangesAreUndoable"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
Yes It Is Possible But Not As You Want
Basically Photoshop Script DOM Have History State Option; But It Only Allows to jump back to History State and Revert It; So It Means You can control Which Step You Want to revert in script: See Below
So Basically In Order to Revert To Any Step You Can Do Something Like This
var docRef = app.activeDocument;
docRef.ActiveHistoryState = docRef.HistoryStates[1];
This Will Revert Your Work And Will Get Back To your 1st History State; Or In Advance If You want To go to specific Step Use Prompt Like Below;
var docRef = app.activeDocument;
var step = prompt("Which step You wanna Go";"");
docRef.ActiveHistoryState = docRef.HistoryStates[step];
But If You Want To access That Specific History Option I'm feared that It Is Possible to access via script;Refer Below Link For More Details; You Can Find More About It On Page Page No .48
I Know This Might Not What You want but hope It Helps You to understand Photoshops DOM; -Regards Phoenix Design
Make Layer Visibility Changes Undoable
. I think I saw once you can alter preferences of Photoshop using ExtendScript, hence I wonder if there is an option to access those.
You can set non-linear history to true like this:
var idsetd = charIDToTypeID( "setd" );
var desc17 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var idPrpr = charIDToTypeID( "Prpr" );
var idCchP = stringIDToTypeID( "historyPreferences" );
ref2.putProperty( idPrpr, idCchP );
var idcapp = charIDToTypeID( "capp" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref2.putEnumerated( idcapp, idOrdn, idTrgt );
desc17.putReference( idnull, ref2 );
var idT = charIDToTypeID( "T " );
var desc18 = new ActionDescriptor();
desc18.putBoolean(stringIDToTypeID("nonLinear"),true);
var idCchP = stringIDToTypeID( "historyPreferences" );
desc17.putObject( idT, idCchP, desc18 );
executeAction( idsetd, desc17, DialogModes.NO );
Older answer: In Photoshop preferences file it is the byte next to "HstN" key with type of boolean. Strings are reversed due to its endianness. Far from perfect but it is readable. If someone changes this after PS start then you won't know it.
1 = enabled.
Settings is loaded/applied with PS startup and saved with PS quit.