Hi! I’m doing some tests with a plugin using batchPlay
and one user report a different result than the others.
In general, the returned placeEvent
object has a replaceLayer
property; but in the case of user B, it is missing.
Why is replaceLayer
missing from one of the results?
Is it perhaps a difference in the active Photoshop settings?
NOTE: The code is called inside a modal context.
Code
const temp_image_name = "plugin-temp:/image.png";
const image_entry = await localFS.getEntryWithUrl(temp_image_name);
const token = localFS.createSessionToken(image_entry);
const result = await action.batchPlay(
[
{
"_obj": "set",
"_target": [
{
"_ref": "channel",
"_property": "selection"
}
],
"to": {
"_enum": "ordinal",
"_value": "none"
},
"_options": {
"dialogOptions": "dontDisplay"
}
},
{
"_obj": "placeEvent",
"null": {
"_path": token,
"_kind": "local"
},
"_options": {
"dialogOptions": "dontDisplay"
}
}
],
{}
);
Results
User A
[
{
"_target": [
{
"_ref": "channel",
"_property": "selection"
}
],
"to": {
"_enum": "ordinal",
"_value": "none"
}
},
{
"_obj": "placeEvent",
"ID": 2,
"null": {
"_path": "C:\\Users\\A\\AppData\\Local\\Temp\\Adobe\\UXP\\PluginsStorage\\PHSP\\25\\Developer\\MyPlugin\\PluginData\\image.png",
"_kind": "local"
},
"freeTransformCenterState": {
"_enum": "quadCenterState",
"_value": "QCSAverage"
},
"offset": {
"_obj": "offset",
"horizontal": {
"_unit": "pixelsUnit",
"_value": 0
},
"vertical": {
"_unit": "pixelsUnit",
"_value": 0
}
},
"replaceLayer": {
"_obj": "placeEvent",
"to": {
"_ref": "layer",
"_id": 2
}
}
}
]
User B
[
{
"_target": [
{
"_ref": "channel",
"_property": "selection"
}
],
"to": {
"_enum": "ordinal",
"_value": "none"
}
},
{
"_obj": "placeEvent",
"ID": 3,
"null": {
"_path": "C:\\Users\\B\\AppData\\Local\\Temp\\Adobe\\UXP\\PluginsStorage\\PHSP\\25\\External\\MyPlugin\\PluginData\\image.png",
"_kind": "local"
},
"freeTransformCenterState": {
"_enum": "quadCenterState",
"_value": "QCSAverage"
},
"offset": {
"_obj": "offset",
"horizontal": {
"_unit": "pixelsUnit",
"_value": 0
},
"vertical": {
"_unit": "pixelsUnit",
"_value": 0
}
}
}
]