tk-photoshop documentation?

I am trying to make an EXR and HDR publish for Photoshop but I'm having trouble working with the Photoshop COM. This is the reference I've been using so far, which I think is also the one linked to on the tk-photoshop page here on the website: http://cssdk.s3-website-us-east-1.amazonaws.com/sdk/1.5/docs/WebHelp/references/csawlib/index.html?com/adobe/photoshop/package-detail.html&com/adobe/photoshop/class-list.html

For example I see in the primary_hook code of the multi-publish app that you call "doc.fullName.nativePath" to get the path of the document, but in the Photoshop COM reference I see nothing about the ".nativePath" part so where did you guys get that from? Like is there a piece of documentation that I'm missing here or what?

What I want to do for the publish is to convert the 32bit file to 8bit to make a thumbnail and then save and publish the file as an EXR and/or HDR. I've not yet looked into the saving mechanism as I'm stuck on the conversion for the thumbnail (which prevents the whole publish from working as it can't save a 32bit file as png/jpeg/etc.). I did see however that there is no "EXRSaveOptions" or "HDRSaveOptions" though in the COM and I doubt I can run the saveAs command properly without those.

Does anyone have a better code reference for working with Photoshop? Or maybe some tips on how to save/export EXR/HDR images from Photoshop?

3 条评论

  • 0
    Rob Blau

    Hi Jeffery,

    The nativePath portion of the API comes from the ActionScript foundation that the Photoshop API is built on top of:

    For the EXR export, the closes example is the save_as code from the photoshop engine:

    That code uses the low level Photoshop Action API to run a "Save As..." without the associated dialog.  You can see the example javascript in the comments and then the translation into our python bridge to the ActionScript based API.  The relevant "Save As" action for EXR saving can be found here:

    For the thumbnail generation, there is an example in the Photoshop engine documentation that does an export for web, which creates an image that should be suitable:

    The third example ("Export the current doc for the web with default options") is the one you want.

  • 0
    Jeffrey Vermeer

    Hi Rob,

    Thanks for the reply!

    I don't have time to look into the EXR stuff right now, but I think I'll be able to figure it out from the links you posted as well as the thumbnail generation (I hadn't really thought of doing an export tbh).

    The nativePath part still confuses me a bit though, but maybe with the AS3 ref you linked I'll be able to figure stuff out if I get stuck again. I guess I just need to get more familiar with the structure of the API, it feels kinda messy to me though.

    Anyway, I'll come back here if I get stuck again, thanks again for the help ;)



  • 0
    Rob Blau

    Hey there Jeffrey, one quick thing worth noting is that the AS3 API in Photoshop is deprecated as of the 2014 CC version.  We are planning on a javascript based engine to replace the current AS3/Flex based one, but that is something to consider before diving too deep into the world of Photoshop Flash programming.