Copy link to clipboard
Copied
OK, so i've been beating my head against a wall here for a few days trying to figure out this script. I've come pretty far with it at this point but still a few things I need to work out. I've got the text size conditional worked out with some help. I've got some good ideas to work out add in some details when my text layers have multiple lines. However, I've noticed my script results differ when I start out with Point vs Paragraph text.
I figure that the best way to combat this is to convert all text to Paragraph text but want to revert text layers that start as Point text back to Point text.
Any ideas?
I've been trying different variations of this:
var doc = activeDocument
var lay = doc.activeLayer
var textSize = lay.textItem.size
var textlayer = doc.activeLayer
var textHeight = textlayer.bounds[3]-textlayer.bounds[1]
var textWidth = textlayer.bounds[2]-textlayer.bounds[0]
var ogTextType = lay.textItem.kind;
textType = paragraphText;
// Additional Scripting
{//
lay.textType = ogTextType;
Copy link to clipboard
Copied
Hi timmysmuckers,
convert paragraph text to point text (and also in the other direction) is a "destructiv" process.
var aTF = app.activeDocument.activeLayer.textItem;
if (aTF.kind == TextType.PARAGRAPHTEXT) {
alert ("to point");
aTF.kind = TextType.POINTTEXT; // but be careful - this will create divis
} else {
alert ("to paragraph");
aTF.kind = TextType.PARAGRAPHTEXT;
}
Have fun
Copy link to clipboard
Copied
Thank you, pixxxel schubser
This helps, but I'm not entirely sure this is doing what I need it to do. I get what you are saying about this being destructive.
However, I don't want to convert paragraph to point text at all. This scripting only seems to only convert point text to paragraph text and vice/versa.
What I want to do is:
Or am am I missing something? Also, no idea what "divis" means.
Thanks,
Tim
Copy link to clipboard
Copied
I've decided to change my approach a bit just to get this solved.
Rather than:
- convert to paragraph text if it isn't already
- perform my other tasks
- convert text back to point text if that was the original state.
I am:
I did use a bit of your script pixxxel schubser, so thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now