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

New document defining bit depth

Contributor ,
Apr 07, 2025 Apr 07, 2025

Hi

I'm trying to script the creation of a document and defining the bit depth based on a tick box in my UI however i keep getting en error

 

BitsPerChannelType.EIGHT

BitsPerChannelType.SIXTEEN

BitsPerChannelType.THIRTYTWO

 

all give me the same error, does this element just not work from the dom?

app.documents.add(
    1920, // Width
    1080, // Height
    72, // Resolution
    "Test Document", // Name
    NewDocumentMode.RGB, // Mode
    BitsPerChannelType.THIRTYTWO // Bit Depth
);
TOPICS
Actions and scripting
85
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
Adobe
Community Expert ,
Apr 07, 2025 Apr 07, 2025

@jackdaw_1066 

 

Pick this apart:

 

app.documents.add(UnitValue(800, "px"), // width
    UnitValue(600, "px"), // height
    72, // resolution
    "test", // name
    NewDocumentMode.RGB, // mode
    DocumentFill.WHITE, // initialFill
    1, // pixelAspectRatio
    BitsPerChannelType.THIRTYTWO, // bitsPerChannel
    "sRGB IEC61966-2.1"); // colorProfileName

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/Documents/add.html#documents-add

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
Contributor ,
Apr 07, 2025 Apr 07, 2025

Hi thanks for getting back to me
Im new to scripting so still trying to get my head around it all, i found the website you shared too but i still can't impliment it.

I tried running your code and it fails

 

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 ,
Apr 08, 2025 Apr 08, 2025
LATEST

Strange, the code worked fine for me which is why I posted it.

 

Beyond DOM code, one could use AM code.

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