How about a textSettingOptions object?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Mike Hale

How about a textSettingOptions object?

Post by Mike Hale »

Several post over the last week or so has me thinking about textItem.

A post by Carsten asked why his code was slow. In a post by farshad, when I ran his code to test why he wasn't getting the size he expected I noticed that Photoshop treats each change to textItem as a new textItem. For example, here is part of Carsten's code

Code: Select allnewTextLayer.textItem.contents = "Text on image";
newTextLayer.textItem.position = Array(8, 8);
newTextLayer.textItem.font = "Verdana";
newTextLayer.textItem.size = 12;
newTextLayer.textItem.color = textColor;

When you run the full script this part alone uses 5 history states. I recreated those steps uses the GUI with scriptlistner on and each of those changes creates a full textItem executeAction. No wonder it is slow, anyone how has seen the output of SL for a textItem change knows how long it is.

However, if you make all those changes at once SL only records one change. What Photoshop needs is an object like BatchOptions or the saveOptions so you can make all your setting then set the textItem one time.

On the Adobe forum today, Xbytor said in part ...I
still need to backport a bunch of my Action code to CS/PS7 and get some
TextRange stuff implemented first.

Xbytor, you may be head of me and already plan something like this as part of your TextRange but I thought I would bring up.

If something like this is not already on your 'To Do' list or it's not something you are interested in, let me know and I will give it a try.

I'm sure it will be better if you do it, but I like this idea enough to try it if you don't care to.

And if someone has already had this idea and found it unworkable - then to quote Gilda Radner, Never mind


Mike
xbytor

How about a textSettingOptions object?

Post by xbytor »

My TextRange class will set up a complete textitem in one call with one massive ActionDescriptor. I have a pretty good idea on how it's going to work. I just need the time to get it implemented.

The TextRange class will let you specify the text and then ranges of that text with different attributes (font, font size, color, etc...). I'll post more details later.
Mike Hale

How about a textSettingOptions object?

Post by Mike Hale »

I thought that you might. I can wait till you have it done. I just wanted to know someone was working on it and I'm glad it's you

Mike