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

Setting History Option with ActionManager

Engaged ,
Apr 04, 2019 Apr 04, 2019

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.

I think r-bin or Kukurykus can me help out there

TOPICS
Actions and scripting
2.0K
Translate
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
LEGEND ,
Apr 04, 2019 Apr 04, 2019

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'))

Translate
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
Engaged ,
Apr 04, 2019 Apr 04, 2019

Kukurykus Yes, I was able to read it but not to write.

r-bin So there is no way to set this at the moment... ok, thanks.

Translate
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
People's Champ ,
Apr 04, 2019 Apr 04, 2019

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);

Translate
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
Engaged ,
Apr 04, 2019 Apr 04, 2019

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).

Translate
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
LEGEND ,
Apr 04, 2019 Apr 04, 2019

I never used it yet, but I think GetterDemo.jsx created xbytor2, however r-bin seems now to be better from him

Translate
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
People's Champ ,
Apr 04, 2019 Apr 04, 2019
Can not say anything.
I do not have CC21019

And in historyPreferences (property for app) there is such a parameter?

Translate
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
Engaged ,
Apr 04, 2019 Apr 04, 2019

Kukurykus oh, you are right, GetterDemo.jsx is from xbytor2

r-bin Parameter of HistoryPrefs are only "MaximumStates", "SnapshotInitial" and "NonLinear".

Translate
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
People's Champ ,
Apr 04, 2019 Apr 04, 2019

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);  

Translate
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
Engaged ,
Apr 04, 2019 Apr 04, 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);

Works for CC2019!

Unfortunately, I need this back to CC 2015. Thanks anyway!

Translate
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
LEGEND ,
Apr 04, 2019 Apr 04, 2019
LATEST

Credits go to r-bin

Translate
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
People's Champ ,
Apr 04, 2019 Apr 04, 2019

I think Adobe forgot to assign it, and some other ticks, an identifier

You can only change "nonLinear" and "snapshotInitial" ticks.

Translate
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