I’m trying to change the rulerUnits via BatchPlay but nothing is happeninig, this is the code I’m using:
require('photoshop').core.executeAsModal(function () {
try {
batchPlay(
[
{
_obj: "set",
_target: [
{
_ref: "property",
_property: "unitsPrefs"
},
{
_ref: "application",
_enum: "ordinal",
_value: "targetEnum"
}
],
to: {
_obj: "unitsPrefs",
rulerUnits: {
_enum: "rulerUnits",
_value: "rulerPixels"
}
},
_options: {
dialogOptions: "dontDisplay"
}
}
], {
synchronousExecution: false,
modalBehavior: "fail"
});
} catch (e) {
console.log(e);
}
});
This doesn’t even logs an error, so I don’t know what is happening. I saw that the RulerUnits constant is not available on the DOM yet so I tried with Batchplay to change it but nothing is happeninig.
Am I doing something wrong?
I appreciate your help.