Ps plugin abilities

hello experts
One question from customer, Currently they are working on a PS plug-in and the functions are similar with XD plugin.

  1. Upload a screenshot of the art board,
  2. Upload the layer information (label)
  3. Convert the user’s layer into a picture, and then upload (sliced images)

They want to know how they can achieve these abilities, thank you for your help

1 Like
  1. Upload a screenshot of the artboard

    • Possible, but a non-obvious. You’ll need to use Document#save to export the document as a PNG or JPEG. This means you’ll need to do some work that extracts the layer you wish to export to create a new temporary document that can then be used to save the rendition. Better APIs are planned for this year, but for now, the process is a bit awkward.
  2. Upload the layer information

    • You can get the layer’s name using the Layer#name. This can be uploaded using fetch, XMLHttpRequest or WebSocket.
  3. Convert the user’s layer into a picture, and then upload (sliced images)

    • May need more context here, but getting a rendition here would be similar to uploading the screenshot of the artboard.
    • Getting slice information will require batchPlay. You’ll want to use Jarda’s excellent Alchemist plugin to discover how this works as what you can do with batchPlay is not otherwise well documented.