I have already tried that. The paste, paste in place, and create new document from the clipboard presets all work fine with batchPlay. Also, batch play can be used to query the layer bounds which also works fine.
The issues isn’t with anything broken in UXP. It is just how Photoshop operates which I’m trying to find a workaround for. When creating a document from the clipboard, it creates the document size minus the transparency.
As an example, say the clipboard is 2400x3000 pixels and contains a person cutout and sized where the user wants within the transparency. Say the the actual size of the person cutout is 1500x2000. Creating a new document form the clipboard preset creates a document at 1500x2000, not 2400x3000. When pasted, the person takes up the entire space of the new document with no margins. When queried for layer bounds using batchPlay, it returns 1500x2000, not 2400x3000.
Photoshop behaves the same way doing everything manually so I don’t think anything in UXP performs differently than it should. However, the information for transparency spacing must be buried somewhere in the clipboard. From the same sizes from the prior example, if a document is manually created at the correct size of 2400x3000 and “paste in place” is used, it will place the cutout of the person in the exact correct location. So paste in place somehow knows what the surrounds extra space is.
I have other programs I have created that can easily work around this. If if the size of the document where the cutout comes from is known, then a new doc can be created at the same size. Then paste in place can be used with no issues. However, in this specific case for this new program, I’m wanting to give the user a “paste from clipboard” option so they can copy/paste from their other documents. With this, the program has no way to know what the original size of the document they copied from was. As this information seems to be stored somewhere on the clipboard, I was trying to figure out if there was a way to query that from the clipboard.