Adam
February 10, 2022, 11:49am
1
Hi,
I’m having a problem with opening File/ Export/ “Export As…” function.
It did work in one of the previous releases of PS.
I was trying to record an Action, add Menu item and then convert it to Batch Play via Occultist but it doesn’t work.
This is what Action records:
This is what Occultist gets:
{
_obj: "select",
_target: [
{
_ref: "menuItemClass",
_enum: "menuItemType",
_value: "exportDocumentAsDialog"
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
I was also trying to use Alchemist to record event but it also doesn’t work:
{
_obj: "invokeCommand",
commandID: 3443,
kcanDispatchWhileModal: true,
_options: {
dialogOptions: "dontDisplay"
}
},
{
_obj: "featureInfo",
active: false,
command: "getFeatureActive",
_options: {
dialogOptions: "dontDisplay"
}
}
No matter what I do I’m just getting errors:
Do you have any idea how to fix it? Thank you!
1 Like
Jarda
February 10, 2022, 2:23pm
2
How about this? Render layer example
And change params to show dialog?
Adam
February 11, 2022, 10:16am
3
Hi Jarda,
I can’t find a piece of code that would do what I want, maybe I’m missing something.
My goal is simple - to open Export As dialog window:
tomzag
February 11, 2022, 1:42pm
4
{
_obj: "select",
_target: [
{
_ref: "menuItemClass",
_enum: "menuItemType",
_value: "exportDocumentAsDialog"
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
Change dialogOptions: "dontDisplay"
to dialogOptions: "display"
.
Adam
February 11, 2022, 1:52pm
5
tomzag:
{
_obj: "select",
_target: [
{
_ref: "menuItemClass",
_enum: "menuItemType",
_value: "exportDocumentAsDialog"
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
Unfortunately it doesn’t work for me. That’s the whole piece of code for this function, I’m still getting an error:
async function exportas() {
await core.executeAsModal(() => {
batchPlay(
[
{
_obj: "select",
_target: [
{
_ref: "menuItemClass",
_enum: "menuItemType",
_value: "exportDocumentAsDialog"
}
],
_options: {
dialogOptions: "display"
}
}
], {});
})
}
document.getElementById("btnexportas").addEventListener("click", exportas);
tomzag
February 11, 2022, 1:54pm
6
Is it possible that you don’t have a document open?
Adam
February 11, 2022, 1:58pm
7
I do have it open I’m using PS v23.1.1 and the plugin based on API 2. That’s the only function that doesn’t work at all. I guess that something was changed in the lates versions of PS reg. export and it’s not fixed yet.
tomzag
February 11, 2022, 2:11pm
8
Working fine for me on Mac with v23.1.1 and API 2.
This error also occurs when PS is in a state where calling this command is not possible. For example when no document is open. Basically always when “Export as” is greyed out in the main menu.
Adam
February 11, 2022, 2:32pm
9
Weird, no matter what I do, it doesn’t work. I have the file opened, I can access export as from the menu but the script doesn’t work.
const psCore = require('photoshop').core;
psCore.performMenuCommand({ "commandID": 3443 });
Be aware, that in very rare cases even command ID can change on Ps update. Like it happened for Select > Subject on upgrade v23.1 to v23.2
1 Like