Copy link to clipboard
Copied
Is there any way to use Zoom Fit to Screen (same as Ctrl+0) in UXP scripting?
In CEP/ExtendScript, we can use as following.
app.runMenuItem(app.charIDToTypeID("FtOn"));
// Fit to Screen (same as Ctrl+0)
It seems not implemented simiar way on Photoshop UXP DOM as
require('photoshop').app.runMenuItem(1182027630);
Result:
From UXP Alchemist plugin's ScriptListner is showing:
{
"_obj": "invokeCommand",
"commandID": 1192,
"kcanDispatchWhileModal": true,
"_isCommand": false
}
From batchPlay(), above seems not runnable (this part is not quite sure).
var result = require('photoshop').action.batchPlay([
{
"_obj": "invokeCommand",
"commandID": 1192,
"kcanDispatchWhileModal": true,
"_isCommand": false
}
], {synchronousExecution: true});
Result:
I'm not quite sure if above is proper usage of batchPlay() as well.
But is there any way to use Zoom Fit to Screen (same as Ctrl+0) in UXP scripting?
Thank you,
Naoki
Copy link to clipboard
Copied
Copy link to clipboard
Copied
haha, one of those again. 😄
Copy link to clipboard
Copied
btw I found now your unposted answer to me: Jun 29, 2021 🙂
Copy link to clipboard
Copied
Hi @Kukurykus
Thank you very much for reply.
But your series of links does not make any sense.
If you know the answer of my question, please post here.
Thank you,
Naoki
Copy link to clipboard
Copied
At end of those links path you find dedicated UXP forum 😉
Copy link to clipboard
Copied
You mean this post and following link.
How to select multiple layers with UXP
I don't think this is correct answer to the question even marked.
Also does not make any sense to this question too.
Copy link to clipboard
Copied
Yes, that what I mean. It's not correct answer indeed, but it leads you to proper forum where you can get replies related to Unified Extensibility Platform. Here is Ps ExtendScript forum.
Copy link to clipboard
Copied
I believe this is Photoshop general forum and not limited to ExtendScript, which is getting depricated. UXP is already included in Photoshop 2021 as main feature. So I think asking UXP question in this forum should be no issue.
Copy link to clipboard
Copied
You can ask of course, but from linked topics you'll see there never was even one answer 🙂
btw. does Naoki-Hada belong to you. If so why do you different (however similar) accounts?
Copy link to clipboard
Copied
That code you put ("invokeCommand")
and photoshop junk
ScriptingListener does not record fit to screen
you should do it by action
try this little code if it works
if (documents.length!=0) {runMenuItem(app.charIDToTypeID("FtOn"));}
Copy link to clipboard
Copied
Thank you very much for your reply.
I know the limitation, that's why I'm asking this question.
Your code is ExtendScript and about same as my 4th line of question.
It does not work on UXP JavaScript, so I'm asking this question.
If you know working UXP code, please let me know.
I'm converting working CEP/ExtendScript code to UXP plugin.
This part is one of the blocker.
Ref. about Listner on UXP
Adobe UXP: Things you need to know! #6 BatchPlay (part 1): the ActionManager roots
Thank you,
Naoki