Odd suspendHistory behavioud
I stumbled upon some strange behaviour of suspendHistory.
In JSX, there are, basically, 2 ways of writing code that I know.
1. When you write public named functions that are later called through the CSInterface bridge.
Like:
myFunc = function() {
//do something
}
2. To make the code a bit more clean I started making kind-of-classes to have common pieces together. For example, a class for all layer-related scripts, or all channel-related scripts.
Like:
function LayersTools() {
this.publicMethod = function() {
}function privateMethod() { ... }
}
Now as it turned out, calling
app.activeDocument.suspendHistory("Test", "myFunc()")
works fine
but
app.activeDocument.suspendHistory("Test", "new LayersTools().publicMethod()")
doesn't suspend internal code of `publicMethod()`
So if, for example, my publicMethod() creates a new layer, this entry will not be suspended.
And if I re-write this as
LayerTools_publicMethod() { //create new layer }
and call it
app.activeDocument.suspendHistory("Test", "LayerTools_publicMethod()")
it will work just fine, all entries will be with suspended history
Does anybody has any insight on this?
