Copy link to clipboard
Copied
I'm trying to set the option "Make Layer Visibility Changes Undoable" (History palette -> History Options).
My code so far (deselect the checkbox):
var d = new ActionDescriptor();
var r = new ActionReference();
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
d.putBoolean(stringIDToTypeID("layerVisibilityChangesAreUndoable"), false);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
I gotta do something wrong. My ActionManager knowledge is limited.
Copy link to clipboard
Copied
If you may check its status you can set it too:
sTT = stringIDToTypeID;
(ref = new ActionReference()).putProperty(sTT('property'), sTT('layerVisibilityChangesAreUndoable'))
ref.putClass(sTT('application')), executeActionGet(ref).getBoolean(sTT('layerVisibilityChangesAreUndoable'))
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hmm...
But in CC219 it can work.
In CC2018 there is definitely no such identifier.
If you have CC2019 check.
I can not check.
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("historyPreferences"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var d1 = new ActionDescriptor();
d1.putBoolean(stringIDToTypeID("layerVisibilityChangesAreUndoable"), true);
d.putReference(stringIDToTypeID("null"), r);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("historyPreferences"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
Copy link to clipboard
Copied
No it's not working.
Also for CC2019 "layerVisibilityChangesAreUndoable" is not a property of "historyPreferences". It's directly listed as a property of the app object (result from your GetterDemo.jsx).
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
try this (sets to true)
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);
d.putBoolean(stringIDToTypeID("layerVisibilityChangesAreUndoable"), true);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
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"), true);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("layerVisibilityChangesAreUndoable"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
var d = new ActionDescriptor();
var r = new ActionReference();
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
var d1 = new ActionDescriptor();
d1.putBoolean(stringIDToTypeID("layerVisibilityChangesAreUndoable"), true);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
Copy link to clipboard
Copied
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);
Works for CC2019!
Unfortunately, I need this back to CC 2015. Thanks anyway!
Copy link to clipboard
Copied
Credits go to r-bin
Copy link to clipboard
Copied
I think Adobe forgot to assign it, and some other ticks, an identifier
You can only change "nonLinear" and "snapshotInitial" ticks.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now