I am trying to access fonts used in the photoshop documents using UXP plugin. While reading the documentation i observed that inside a layer there is only 1 text item. So suppose if inside one layer what if multiple fonts are used. In that case i am not able to get all the fonts used. Is there any other way to get all the fonts used in photoshop ?
With batchPlay you could get that info. Here I have Advanced font remapping 1.0 https://www.mightyplugins.cc/magic-scripts
It reads all fonts in all selected layers and allows you to remap them. This uses Action Manager code in Extend Script… in UXP it looks differently. Harder to read and understand on how this would translate to UXP batchPlay.
Hi,
Thanks for the reply. I just got to know about batchPlay. I tried to find documentation around actions available but i was not able to get that. If you have any source through which i cam get that. Can you please share ?
There is no documentation for action descriptors. The original idea is we are not supposed to work with low-level action descriptors but use DOM instead.
Problem with DOM is that it matches features of Photoshop CS3 from 2007 or something like that. But not all of them. Layer masks were introduced in 1994 in PS 3.0 and 30 years later there is no DOM API to create/remove layer masks. So you have to use action manager code (batchPlay). And there is currently no vision to add new features into DOM.
So you can only reverse-engineer internal action. Usually, those have often various quirks and is not always easy to understand them. I created Alchemist plugin. It can help you with it a bit.
But back to your original question… for Text layers. It has DOM API and is quite good. But does not involve text ranges and paragraph ranges intentionally by design.