Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto populating text fields. Text insert question. 2

Status
Not open for further replies.

stevef22

Technical User
Sep 20, 2005
83
US
Hello and good day to everyone, glad to be a part of this forum! I am going to stick around this site, GREAT INFORMATION!

My question is how do I insert text faster? I am bulding a plaque. Booooring yes I know but necessary. Anyone know how to set up "pre-determined" text fields that populate from an internal or external text? Right now I have to >duplicate layer>drag layer to new spot>enter in new text. It would be really neat if PS could populate from a file like web-site populate pages from other text files. If anyone knows a faster way to enter in this text then your are the PS GURU. Thanks again.
Steve
attachment.php
 
Hi Steve

Firstly i would like to thank you for a fantasticly presented question - there is no ambiguity about what you need to achieve

I would personally write a Perl script to open a text file, parse the data & write it out to a Postscript file. This can be rasterised into Photoshop and designed to fit exactly over the top

Now you may or may not have access to a scripting language like Perl, or you may shudder at the thought of writing raw Postscript... but it's a start

You may, however, know what i am trying to say


Kind Regards
Duncan
 
Thanks but I really dont know any programming. Any other sugguestions?
 
That sure is an interesting suggestion though, gee if I could script some Perl that would be awesome. Anyone want to make some for me? : )
 
Trojan - guess i must be a geek!

Steve - I'm sure we can help!


Kind Regards
Duncan
 
try this out:-

Code:
%---------- Procedures ----------

/cm {28.3464567 mul} def

%---------- Postscript ----------

1 cm 1 cm moveto
/Helvetica findfont 8 scalefont setfont
(Duncan) show

2 cm 2 cm moveto
/Helvetica findfont 10 scalefont setfont
(Duncan) show

3 cm 3 cm moveto
/Helvetica findfont 12 scalefont setfont
(Duncan) show

10.5 cm 10 cm moveto
/Helvetica-Bold findfont 24 scalefont setfont
(Centred Heading Example) dup stringwidth pop 2 div neg 0 rmoveto show

10.5 cm 12 cm moveto
/Helvetica-Bold findfont 24 scalefont setfont
(Another Centred Heading Example) dup stringwidth pop 2 div neg 0 rmoveto show

21 cm 14 cm moveto
/Helvetica-Bold findfont 36 scalefont setfont
(Right-Aligned Example) dup stringwidth pop neg 0 rmoveto show

21 cm 16 cm moveto
/Helvetica-Bold findfont 24 scalefont setfont
(Another Right-Aligned Example) dup stringwidth pop neg 0 rmoveto show

showpage


Kind Regards
Duncan
 
sorry - it requires a string at the beginning to work:-

Code:
%!PS

%---------- Procedures ----------

/cm {28.3464567 mul} def

%---------- Postscript ----------

1 cm 1 cm moveto
/Helvetica findfont 8 scalefont setfont
(Duncan) show

2 cm 2 cm moveto
/Helvetica findfont 10 scalefont setfont
(Duncan) show

3 cm 3 cm moveto
/Helvetica findfont 12 scalefont setfont
(Duncan) show

10.5 cm 10 cm moveto
/Helvetica-Bold findfont 24 scalefont setfont
(Centred Heading Example) dup stringwidth pop 2 div neg 0 rmoveto show

10.5 cm 12 cm moveto
/Helvetica-Bold findfont 24 scalefont setfont
(Another Centred Heading Example) dup stringwidth pop 2 div neg 0 rmoveto show

21 cm 14 cm moveto
/Helvetica-Bold findfont 36 scalefont setfont
(Right-Aligned Example) dup stringwidth pop neg 0 rmoveto show

21 cm 16 cm moveto
/Helvetica-Bold findfont 24 scalefont setfont
(Another Right-Aligned Example) dup stringwidth pop neg 0 rmoveto show

showpage

save it as an ASCII file - with a name ending in .ps

then you can import it into Photoshop


Kind Regards
Duncan
 
This would be a great way to solve this problem

Text (which he has) -> Perl (manipulate text] -> Postscript (still text) -> Photoshop


Kind Regards
Duncan
 
Now you just need to create a .ps file that has all the little panels encoded so you can layout the text in each panel!
;-)


Trojan.
 
A main Perl loop to count to say 48 - and if %4 then increment in the downwards direction. Result - 48 plaque entries on a 4 x 12 grid!


Kind Regards
Duncan
 
Exactly - this can all be done with one file


Kind Regards
Duncan
 
You can write this code just as easily as I and you know postscript better than I do so I guess the ball is in your court Duncs.


Trojan.
 
and the 10 bucks!!! ... that's about £0.555679 - not bad!!!


Kind Regards
Duncan
 
Wow wow, you guys just blew my mind, I am saving code now as ASCII file.... very cool. What's all this talk about a main perl loop count? Is that another file I need to get this thing to work from start to finish?
Thanks so very much,
Steve
 
Just give me a minute to get this thing working and I will Pay Pal you the money! : )

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top