Anyone have an idea how to open new Export As window with UXP or Batch play?
I really need this for my script.
Thank you!
Anyone have an idea how to open new Export As window with UXP or Batch play?
I really need this for my script.
Thank you!
Alchemist listener doesnāt record anything useful. Maybe Iām doing something wrong?
Not sure how command IDs are consistent among platforms (Win/Mac) and version upgrades, but I think performMenuCommand()
is what youāre looking for. Iāve read somewhere here on forum, that only negative command IDs are not consistent, but canāt confirm.
Command ID youāre looking for, is 3443
for Export As...
You can get all commands from menuBarInfo
(thanks @Jarda)
ps.action.batchPlay([
{
"_obj": "get",
"_target": [
{"_property": "menuBarInfo"},
{"_ref": "application", "_enum": "ordinal", "_value": "targetEnum"}
]
}
], {
synchronousExecution: true,
modalBehavior: 'execute'
})[0]
Or you could record action in action panel where you would click āadd menu itemā in action panel menu. Then save .atn file and load it with Occultist to see what code will be generated.
Thank you so much! Itās exactly what I was looking for!
Thank you Jarda, I donāt thought about that. Itās a great solution.
This is what works for me:
async function saveforweb() {
await core.executeAsModal(() => {
batchPlay(
[
{
_obj: 'select',
_target:
{
_ref: 'menuItemClass',
_enum: 'menuItemType',
_value: 'exportDocumentAsDialog'
}
,
_options: {
dialogOptions: 'display'
}
}
], {});
})
}
Did you get this from Occultist? I think this might come in handy for me also at some point
Yes, Iāve created an Action, added menu item, then Iāve saved an action and opened it in Occultist.
The only thing Iāve changed was dialogOptions: ādontDisplayā ā> display