Skip to main content
January 16, 2009
Question

Saving text box alignment information

  • January 16, 2009
  • 2 replies
  • 521 views
Before I start researching and experimenting - I'm wondering if someone could tell me if it will be possible for me to write a script that either saves text box alignment information in my exported .svg graphic or captures the information in a separate data structure for later inclusion. In AI10 the attribute "text-align" was included in the or elements. It is no longer included using CS3.

Thanks in advance for any suggestions before I get started.
Steve
This topic has been closed for replies.

2 replies

Known Participant
January 16, 2009
How you want to format the data is up to you - but here is the basics for outputting to a txt file<br /><br />var myDoc = app.activeDocument;<br />var f = new File("/Users/steve/output.txt");<br />f.encoding = "BINARY";<br />f.open("w");<br /><br />for (i=0;i<myDoc.textFrames.length;i++)<br />{<br /> f.write( myDoc.textFrames.paragraphs[0].contents+' '+myDoc.textFrames.paragraphs[0].justification); <br />}<br /><br />f.close();
January 16, 2009
It looks like the information is available to me based on the results I get when I uset the following:<br /><br />for (i=0; i<sourceDoc.textFrames.length; i++)<br />{confirm('testOut: '+sourceDoc.textFrames.paragraphs[0].contents+ ' '+sourceDoc.textFrames.paragraphs[0].justification)<br /> }<br /> }<br /><br />But is there a way to write out a simple .txt file with the collective contents of this construct?