Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

To get a histogram using UXP Scripting

Community Beginner ,
Nov 17, 2024 Nov 17, 2024

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)

637
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Nov 18, 2024 Nov 18, 2024

確かにエラーが起きますし、ほかの開発者からも同様の報告があります。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.

...
Translate
Adobe
Community Beginner ,
Nov 17, 2024 Nov 17, 2024

Photoshop version is 26.0.0 and all channels are shown.

UXP Developer Tools version is 2.0.2.3.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2024 Nov 18, 2024

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">
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 18, 2024 Nov 18, 2024

Thanks for the reply. I figured out how to use it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 18, 2024 Nov 18, 2024

確かにエラーが起きますし、ほかの開発者からも同様の報告があります。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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 18, 2024 Nov 18, 2024
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines