Copy link to clipboard
Copied
To get a histogram of the red channel using ExtendScript Toolkit, I can do the following.
var h = activeDocument.height;
activeDocument.selection.select([[0,0],[0,h],[1,h],[1,0]]);
var data = activeDocument.channels[0].histogram;
However, using the UXP Developer Tools, I get an error when I do the following.
const { app } = require(“photoshop”);
const doc = app.activeDocument;
doc.selection.selectColumn(0);
console.log(doc.channels[0].histogram);
This link has a property to get the histogram, what am I doing wrong?
Translated with www.DeepL.com/Translator (free version)
確かにエラーが起きますし、ほかの開発者からも同様の報告があります。batchPlay経由なら取得できるようです。
ただし、普通にやると言語ごとにredの名前の部分をローカライズして取得しなければいけません。そんなときはこちらのindexでチャンネルを取得する方法を参考にしてください。
ちなみに、UXPの開発者は Adobe Creative Cloud Developer Forums のほうに集まっていますので、次回からはそちらへの投稿がおすすめです。
---
It does indeed throw an error, and other developers have reported the same. Seems to be possible to get it via batchPlay.
...Copy link to clipboard
Copied
Photoshop version is 26.0.0 and all channels are shown.
UXP Developer Tools version is 2.0.2.3.
Copy link to clipboard
Copied
in the future, to find the best place to post your message, use the list here, https://community.adobe.com/
p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.
<"moved from using the community">
Copy link to clipboard
Copied
Thanks for the reply. I figured out how to use it.
Copy link to clipboard
Copied
確かにエラーが起きますし、ほかの開発者からも同様の報告があります。batchPlay経由なら取得できるようです。
ただし、普通にやると言語ごとにredの名前の部分をローカライズして取得しなければいけません。そんなときはこちらのindexでチャンネルを取得する方法を参考にしてください。
ちなみに、UXPの開発者は Adobe Creative Cloud Developer Forums のほうに集まっていますので、次回からはそちらへの投稿がおすすめです。
---
It does indeed throw an error, and other developers have reported the same. Seems to be possible to get it via batchPlay.
However, if you do it normally, you have to localize the red name part for each language to get it. In such a case, please refer to this method of getting channels by index.
By the way, UXP developers gather at Adobe Creative Cloud Developer Forums, so it is recommended to post there from next time.
Copy link to clipboard
Copied
Thanks for the reply. I understood it as a bug. I will post to that Forum in the future.
I am not familiar with this site, so thanks for letting me know.