Copy link to clipboard
Copied
Hello dears!
The question in the topic title. How can the script first to include a non-linear history, and then disable?
It is necessary that it was done not manually in the history options palette, but in the script.
Thanks in advance
I tried it by Action Manager, but couldn't figure out why it doesn't work. I assume it has as you can do the same by DOM as JJMack mentioned: preferences.nonLinearHistory = true. Possibly someone will be smarter to use Action Manager for it.
Copy link to clipboard
Copied
A script I believe can use Photoshop history states note history state delete Photoshop history states or some history states revert to a history state and suspend recording history states. I have no ideas what you mean by "include a non-linear history".
There is a reference to a nonLinearHistory boolean its Read-write on page160 of the Adobe JavaScript reference has something to do with preferences. You can set preferences in a scripts so you can set it to true and false its Read-write. I just do not know what a non Linear History means.
Edit:
I started reading working with nonlinear history but stopped does not seem to be something I would find useful or want to do. I would more likely change my mind later and re-do the process anyway.
Working with nonlinear histories | Introduction to Using Adobe Photoshop CS4 | Peachpit
Copy link to clipboard
Copied
I apologize for my poor English. I meant setting a tick for this mode in the history palette. Unfortunately, I'm not good at scripts. So I could not figure out that it is done in one line.
The problem itself was as follows. There is a script that performs a number of actions. In the process of his work formed snapshots. And there is a return to them at different stages of the script. It is necessary to keep the entire history before the script starts. And in the process of the script history did not work. But since there are returns to the snapshots, the whole previous story was deleted. And in the nonlinear mode is preserved. Perhaps all this could be done differently and easier. But I don't know And now everything works. Thank you!
Copy link to clipboard
Copied
I tried it by Action Manager, but couldn't figure out why it doesn't work. I assume it has as you can do the same by DOM as JJMack mentioned: preferences.nonLinearHistory = true. Possibly someone will be smarter to use Action Manager for it.
Copy link to clipboard
Copied
Thank you! That's what you need! Everything worked as it should.
Copy link to clipboard
Copied
I tried it by Action Manager, but couldn't figure out why it doesn't work. I assume it has as you can do the same by DOM as JJMack mentioned: preferences.nonLinearHistory = true. Possibly someone will be smarter to use Action Manager for it.
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("historyPreferences"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
var d1 = new ActionDescriptor();
d1.putInteger(stringIDToTypeID("nonLinear"), true);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("historyPreferences"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
Copy link to clipboard
Copied
I missed second descriptor in my code, however correctly there should be putBooleand not putInteger in your code?
Copy link to clipboard
Copied
Yes, I screwed up
Copy link to clipboard
Copied
No, it works.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now