Copy link to clipboard
Copied
I have read threads that the only way to keep words together for imported text (javascript supplied) in Photoshop is to select the text after import and use the character palette menu to apply "No Break" styling, like Superscript, All Caps and Small Caps which also appear on that menu (I don't see No Break as a palette button).
What I'd like to do is have a simple programatic way to ensure specific words will stay together without the 200+ lines of code that will be necessary to duplicate the way ActionManager seems to record this process of selecting words and applying the character style attribute. Same problem with applying the underlined or superscript attribute.
There seems to be no tag or way to style incoming text as a substring to the entire string of content being imported. I'd prefer avoiding Character or Paragraph Stylesheets, if that's part of the answer, because they are behaving opposite of what they should when importing text with javascript, as determined in a previous thread about importing text in general.
Thanks in advance for any help or confirmation that it's not possible.
Copy link to clipboard
Copied
Not really sure if I get it, but have you tried making the layer a point-text (not paragraph) so it doesn't wrap and then add line changes to the places where it should break? Also there are lots of invisible chars that would not break, but then that is an issue if its code and needs to be parsed. Maybe if you can swap the chars back to spaces before parsing.
Copy link to clipboard
Copied
I'm not sure that PS responds to non-breaking spaces. I tried to insert one and nothing happened. You can use the flyout menu from the character panel to insert a non-breaking space, but you have to select the words before and after the space to do so.