Modifying type layer content without losing internal styles

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

bosunandtenille

Modifying type layer content without losing internal styles

Post by bosunandtenille »

I want to extract a section of an existing type layer to a new empty type layer while preserving any formatting the extracted text is using. The original layer that might have arbitrary internal style runs, so I'm not just talking about the global default style for the layer.

Is this possible?

I was hoping I could duplicate the type layer and then simply delete the sections of text I don't want, but using the scripting listener makes me think that is a hugely complex operation even for a simple type layer. It seems to require tracking and updating all the styles of all the style runs. (I made a type layer with a single style and a couple of words as a test and manually deleting the first character of the layer resulted in a scripting log that was 260K!)

Is there some way to select and delete some of the text in a type layer and have Photoshop deal with updating the style runs the way it does when you manually edit the layer? Any other ideas?

Thanks!