-
1. Re: Help, Need to change ExportType
Larry G. Schneider Apr 29, 2011 11:01 AM (in response to RichardM0701)What exactly are you trying to achieve? It's make no sense to export an AI file as text. Usually there's very little text in an AI file.
-
2. Re: Help, Need to change ExportType
RichardM0701 Apr 29, 2011 12:12 PM (in response to Larry G. Schneider)Hi Larry,
I write large technical manuals with a large number of illustrations. The illustrations that have text in them I have to extract the text for translations. What I’m trying to do is automate the process by making a batch operation to do this for me which in return will automate my action of having to go export each one to a text file individually. I have attached two screenshots to help explain.
-
3. Re: Help, Need to change ExportType
Muppet Mark-QAl63s Apr 29, 2011 12:49 PM (in response to RichardM0701)Larry is right there is no such thing as a 'save as' or 'export' to text file in Illustrator scripting… You would need to loop all the stories or text frames and use the standard write to file method…
-
4. Re: Help, Need to change ExportType
Muppet Mark-QAl63s Apr 29, 2011 1:28 PM (in response to Muppet Mark-QAl63s)here are the bare bone things you may need…
#target illustrator var textFile = File('~/Desktop/AI.txt'); var doc = app.activeDocument; var docText = ''; for (var i = 0; i < doc.textFrames.length; i++) { docText += doc.textFrames[i].contents + '\r'; } textFile.open('e'); textFile.write(docText); textFile.close();I made no checks for an open doc or if it contained any text but you should get the general principle…
-
5. Re: Help, Need to change ExportType
Larry G. Schneider Apr 29, 2011 2:35 PM (in response to RichardM0701)So what you want to do is select all the text frames in a file, copy/paste them into a new file and export as a PDF. At least that's my proposed workflow.
Sorry I've been testing some other things and see mark has beaten me to it.
Works just fine.
-
6. Re: Help, Need to change ExportType
dsdsdsdsd Jun 4, 2012 1:19 AM (in response to Muppet Mark-QAl63s)hello;
where did File class come from, please ... I do not see it within the illustrator_scripting_reference_javascript.pdf.
thanks.
-
7. Re: Help, Need to change ExportType
Muppet Mark Jun 4, 2012 1:33 AM (in response to dsdsdsdsd)The scripting PDF guides are specific to each app's DOM. For the classes etc. that are NOT there is a general guide JavaScript Tools Guide CS5.pdf for which ever instal you have that should be in the toolkit folder. There are classes for file system access as well as others. You can also see these in the toolkit if you use the object model viewer (OMV). That's comm+/ or in the help menu
-
8. Re: Help, Need to change ExportType
dsdsdsdsd Jun 4, 2012 2:09 AM (in response to Muppet Mark)I am getting off topic here ... sorry ... just curious though about the File class .... when I go to: https://developer.mozilla.org/en/JavaScript/Reference, it does not show the File class? I did find it in the OMV, but I prefer to rely on core documentations.
any thoughts?
again, sorry for taking the thread off topic!!!
-
-
10. Re: Help, Need to change ExportType
[Jongware] Jun 4, 2012 7:17 AM (in response to Muppet Mark)Muppet Mark wrote:
... See core classes here…
Or, if you abhor that abonimable interface as much as I do , see here: http://jongware.mit.edu/Js/index_1.html
It's the same information but with a much nicer presentation. (And lots more useful inter-subject links.)
-
11. Re: Help, Need to change ExportType
Muppet Mark Jun 4, 2012 8:35 AM (in response to [Jongware])CS6 ? :







