textFont
hi,
here script muppet mark (until not work anymore ;-) ) modified stucked @ line 25
if comment it works.
jpd
---------------------- noname1.txt ----------------------
1 /* target illustrator */
2
3 function main() {
4 if (app.documents.length == 0) {
5 alert("please have 'illustrator' document before running script.");
6 return;
7 }
8
9 var docref = app.activedocument;
10
11 (docref) {
12 var thisdate = gettodaysdate();
13 var docname = name;
14 var rectref = pathitems.rectangle(-72,0,600,84); // t,l,w,h
15 var tclayer = layers.add();
16 var areatextref = tclayer.textframes.areatext(rectref);
17 var docref=app.activedocument;
18 var docname=activedocument.name;
19 var droits = "copyright " + gettodaysdate();
20 var texte = "\rthis work may not reproduced electronically nor reprinted without permission of copyright holder.";
21 var textstring =droits + "\rjeanpierredaviau.com\r" + docref.fullname + " " + texte;
22 tclayer.name = 'copyright';
23 tclayer.zorder(zordermethod.sendtoback) ;
24 areatextref.textrange.characterattributes.size = 10;
25 //textref.textrange.characterattributes.textfont =textfonts.getbyname(textfonts[i].name);
26 areatextref.textrange.characterattributes.textfont.typename = textfonts.getbyname("adobe textpro-it");
27 areatextref.contents = textstring;
28 }
29 }
30
31 main();
32
33 function gettodaysdate() {
34 var today = new date();
35 var dd = today.getdate();
36 if (dd < 10) {dd ='0' + dd};
37
38 var mm = today.getmonth() + 1;
39 if (mm < 10) {mm ='0' + mm};
40
41 var yyyy = today.getfullyear();
42 var heure=today.gethours() + ":" + today.getminutes();
43
44 var thisdate = dd + '/' + mm + '/' + yyyy + " " + heure;
45
46
47 return thisdate;
48 }
49
24 areatextref.textrange.characterattributes.size = 10;
25 //textref.textrange.characterattributes.textfont =textfonts.getbyname(textfonts[i].name);
c'est areatextref qui est déclaré et non pas textref...
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment