Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

script to take a text layer and put each word on own layer?

New Here ,
Mar 24, 2008 Mar 24, 2008
I have a text layer with a big paragraph of text in it. some of the words are different sizes & colors. Anyone know of a script that could take the paragraph text layer and then put each word on it's own layer keeping the size/color and position in tact?

Thanks
TOPICS
Actions and scripting
526
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Explorer ,
Mar 24, 2008 Mar 24, 2008
patrick_tulipano@adobeforums.com wrote:
> I have a text layer with a big paragraph of text in it. some of the words are different sizes & colors. Anyone know of a script that could take the paragraph text layer and then put each word on it's own layer keeping the size/color and position in tact?

I don't think such a beast exists. One approach is to insert a work, check the
bounds, insert another word into that layer, check the new bounds, compute the
bounds of where the new word is, insert that word into a new text layer with
those bounds. Repeat until done, then remove all text from the original layer
except the first word.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 24, 2008 Mar 24, 2008
I don't know if the logistics for this would be possible. My best guess for a rough draft:

Duplicate your text layer

Starting from the last word, create a new layer with just that word.

Set it's bottom to match your duplicated layer.

Set it's right edge to match your duplicated layer minus the length of the words(layers) you have already made for this row, minus a few pixels for word space.

Delete the word from the duplicated layer (don't forget to delete any spaces as well).

If the height of the text has changed, then realign the layers you have created for this row with the left edge of the duplicated layers, otherwise, process the next word.

Start over with the next row of text.

If the text layer is rotated, I don't know of anything that could work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 24, 2008 Mar 24, 2008
LATEST
Because there are different sizes and color, I would think that you would also need to get the layer's textItem descriptor to know the contents of all the text ranges.

With the text ranges known you could build a word position map as Xbytor suggested.

Mike
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines