Skip to main content
Participant
March 23, 2009
Question

Script to edit actual text in type layer with number generation?

  • March 23, 2009
  • 16 replies
  • 2334 views
Excuse me if this is a dumb question, is there a way to write a script that will edit the actual text in a Type layer?

For example, I have to create a few hundred slates. Each one has a year and an issue number. There are only 17 years I have to do, but hundreds of issues. I would like to create just a template for each year and run a script that creates a slate with a different issue number for each. They would run 001 to 100, for example.

Basically I would need to script something that opens a document, opens the type layer for editing and generates a number (counting 001 to ###), then repeats with a continuing number in each document.

Thanks for any advice you can give, or if you know of a script in existence that may be able to help me!
This topic has been closed for replies.

16 replies

Known Participant
March 27, 2009
I want to extend this script to concatenate the numbered images into a horizontal filmstrip type of image containing all of them (say 40 to 1 in left to right order). I started a new thread as it seemed sensible.

http://www.adobeforums.com/webx/.59b86c81
Known Participant
March 26, 2009
Yes, good idea. I'm on CS3 but this command should be supported I guess.
Known Participant
March 26, 2009
Wide_Eyed_Pupil@adobeforums.com wrote:
> Yes, good idea. I'm on CS3 but this command should be supported I guess.

Document.exportDocument takes ExportOptionsSaveForWeb as an argument.
c.pfaffenbichler
Community Expert
Community Expert
March 26, 2009
WEP, instead of batching after the fact You could try including the Save For Web in the Script  »Photoshop CS4 JavaScript Ref.pdf« should contain all the necessary information.
Inspiring
March 26, 2009
The problem is the metadata not the profile. The profile is saved as a string ie 'Adobe RGB'. The metadata adds about 32k to a file.

Save for web removes the metadata and has an option for the profile
Known Participant
March 26, 2009
Actually I just checked the script and I had changed line 29 to:

jpgopts.embedProfile = false;

so can't be the profile.

Anyhow I've got the result I wanted. Thanks for the script!
Known Participant
March 26, 2009
Yes must be "save for web" removes the profile as opposed to regular save.
Known Participant
March 26, 2009
Well further examination shows image is showing jpeg deteriation but file size is still 60K as is full quality. Batching save for web at quality=9 got them down to 4K.
c.pfaffenbichler
Community Expert
Community Expert
March 26, 2009
In case You edited the Script, please go over it and make sure that the variable-name is always written exactly the same; other than that I wouldnt know how it could happen that the settings get ignored.
Or maybe, if the file is really small in pixel-dimensions, the size depends more on the embedded profile  
Known Participant
March 26, 2009
So just to repeat myself, jpopts var being ignored in script. I event set it to 1 and same file size.
Known Participant
March 26, 2009
Oh sorry just editted as you were answering previous question . I'm working with script now.