Script for export all text in single rtf file?

Hi!
I need to export all storys from indd document to a single rtf file. Is there avaible some free script for CS4 which can do that?

if(app.documents.length != 0){
     if(app.documents.item(0).stories.length != 0){
          myGetFileName(app.documents.item(0).name);
//========================= FUNCTIONS ===========================
function myGetFileName(myDocumentName){
     var myFilePath = File.saveDialog("Save Exported File As:");
     if(myFilePath != null){
          myDisplayDialog(myDocumentName, myFilePath);
function myDisplayDialog(myDocumentName, myFilePath){
     //Need to get export format, story separator.
     var myExportFormats = ["Text Only", "Tagged Text", "RTF"];
     var myDialog = app.dialogs.add({name:"ExportAllStories"});
     with(myDialog.dialogColumns.add()){
          with(dialogRows.add()){
               with(dialogColumns.add()){
                    var myExportFormatDropdown = dropdowns.add({stringList:myExportFormats, selectedIndex:0});
          with(dialogRows.add()){
               var myAddSeparatorCheckbox = checkboxControls.add({staticLabel:"Add separator line", checkedState:true});
     var myResult = myDialog.show();
     if(myResult == true){
          var myExportFormat = myExportFormats[myExportFormatDropdown.selectedIndex];
          var myAddSeparator = myAddSeparatorCheckbox.checkedState;
          myDialog.destroy();
          myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator);
     else{
          myDialog.destroy();
function myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator){
     var myPage, myStory;
     var myExportedStories = [];
     var myTempFolder = Folder.temp;
     var myTempFile = File(myTempFolder + "/tempTextFile.txt");
     var myNewDocument = app.documents.add();
     var myDocument = app.documents.item(myDocumentName);
     var myTextFrame = myNewDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myNewDocument, myNewDocument.pages.item(0))});
     var myNewStory = myTextFrame.parentStory;
     for (var i = 0; i < myDocument.pages.length; i++) {
          myPage = myDocument.pages.item(i);
          for (var t = 0; t < myPage.textFrames.length; t++){
               myStory = myPage.textFrames[t].parentStory;
               if (!IsInArray(myStory.id, myExportedStories)) {
                    //Export the story as tagged text.
                    myStory.exportFile(ExportFormat.taggedText, myTempFile);
                    myExportedStories.push(myStory.id);
                    //Import (place) the file at the end of the temporary story.
                    myNewStory.insertionPoints.item(-1).place(myTempFile);
                    //If the imported text did not end with a return, enter a return
                    //to keep the stories from running together.
                    if(i != myDocument.stories.length -1){
                         if(myNewStory.characters.item(-1).contents != "\r"){
                              myNewStory.insertionPoints.item(-1).contents = "\r";
                         if(myAddSeparator == true){
                              myNewStory.insertionPoints.item(-1).contents = "----------------------------------------\r";
               } // if not exported
          } // for text frames
     } // for pages
     switch(myExportFormat){
          case "Text Only":
               myFormat = ExportFormat.textType;
               myExtension = ".txt"
               break;
          case "RTF":
               myFormat = ExportFormat.RTF;
               myExtension = ".rtf"
               break;
          case "Tagged Text":
               myFormat = ExportFormat.taggedText;
               myExtension = ".txt"
               break;
     myNewStory.exportFile(myFormat, File(myFilePath));
     myNewDocument.close(SaveOptions.no);
     myTempFile.remove();
function myGetBounds(myDocument, myPage){
     var myPageWidth = myDocument.documentPreferences.pageWidth;
     var myPageHeight = myDocument.documentPreferences.pageHeight
     if(myPage.side == PageSideOptions.leftHand){
          var myX2 = myPage.marginPreferences.left;
          var myX1 = myPage.marginPreferences.right;
     else{
          var myX1 = myPage.marginPreferences.left;
          var myX2 = myPage.marginPreferences.right;
     var myY1 = myPage.marginPreferences.top;
     var myX2 = myPageWidth - myX2;
     var myY2 = myPageHeight - myPage.marginPreferences.bottom;
     return [myY1, myX1, myY2, myX2];
function IsInArray(myString, myArray) {
     for (x in myArray) {
          if (myString == myArray[x]) {
               return true;
     return false;
This is a revised version of the script --  not totally tested.
Kasyan

Similar Messages

  • Script for exporting all stories to one RTF file

    Hi, I've been searching for this as I know it's been asked before, but I haven't had any luck finding it yet: Wasn't there a script that someone developed which would allow you to export all stories from an InDesign document into a single RTF file? Or is that wishful thinking....
    Thanks, Phyllis

    http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    Kasyan

  • Hello i need a help about script to export translatable text strings from ai files and import them back

    Hello i need a help about script to export translatable text strings from ai files and import them back after editing, thanks in advance

    Lanny -
    Thank you for taking the time to help with this problem. Can I just say however that as someone who has posted a first comment here and quite clearly never used a forum like this before, your comment unfortunately comes across as very excluding. It makes me feel there are a set of unwritten rules that I should know, and that I don't know them shows that the forum is not for me. In short, it's exactly the kind of response that stops people like me using forums like this.
    I'm sure it's not intended to be received like this and I am sure that the way you have responded is quite normal in the rules of a forum like this. However, it is not normal for those of us who aren't familiar with forums and who only encounter them when they have a genuine problem. This is why I hope it is helpful to respond in full.
    The reason I posted here is as follows. I was directed here by the apple support website. The original comment seemed to be the only one I could find which referred to my issue. As there is no obvious guidance on how to post on a forum like this it seemed perfectly reasonable to try and join in a conversation which might solve more than one problem at once.
    Bee's reply however is both helpful and warm. This could in fact be a template for how new members should be welcomed and inducted into the rules of the forum in a friendly and inclusive way. Thank you very much indeed Bee!

  • Script for export in datapump  -- help needed !!!

    hello all,
    i am using the following script as batch file in my database for export
    script:
    =========
    exp name/password file=d:\exp\%date%.dmp full=y log=d:\exp\exp.log an this will replace the first file(monday) on next monday.
    similar way i need a script for data pump for full database export using datapump
    thanks ,
    gold

    login to database as a dba and create directory for your dumpfile path.
    create directory dpump_dir as 'd:\exp';
    and then use the below script for export.
    expdp username/password full=y directory=dpump_dir dumpfile=%date%.dmp logfile=exp.log

  • Report of Groups owned along with group memberships for each group, all in a single .csv file

    Hello all,
    What I'm trying to do is generate a report of all groups owned by a specific user, along with the group memberships, and output it all to a single .csv file. In the .csv file, I would like to have the group names as the column headers, and underneath
    the group name, list all the members of the group down through the column. So for example, if User1 owns 3 groups, the output would look like:
    What I'm having trouble with is outputting the objects to the .csv using New-Object psobject, and I'm starting to wonder if there is an easier way to do this and my brain is just fried.
    Any ideas?

    OK so I can try and give some code here, but I'm asking more of a concept question about how PowerShell builds objects so I'm not sure it will help....
    $User = "User1"
    get-adgroup -filter {managedby -eq $user} -pr member | %{
    $_.name
    $_.member
    OK so this is a simple script that outputs a group name followed by the membership, all in a single column. What I would like is for the group names to each be the header of a column, and have the membership listed underneath. For example:
    Is this possible in PowerShell?

  • Export all text

    Hello All,
    I would like to export all text with the TextExportPreferences as
    .CharacterSet = idTextExportCharacterSet.idUnicode
    .Platform = idImportPlatform.idPC
    to test.txt file for active indesign file.
    Can you please suggest the vbscript for this?
    I have the part of it as ....the second part which will iterate through all text ....
    Rem TextExportPreferences.vbs
    Rem An InDesign CS3 VBScript
    Rem
    Rem Sets the text export filter preferences.
    Rem
    Set myInDesign = CreateObject("InDesign.Application.CS3")
    With myInDesign.TextExportPreferences
        Rem Options for characterSet:
        Rem idTextExportCharacterSet.idUnicode
        Rem idTextExportCharacterSet.idDefaultPlatform
        .CharacterSet = idTextExportCharacterSet.idUnicode
        Rem platform options:
        Rem idImportPlatform.idMacintosh
        Rem idImportPlatform.idPC
        .Platform = idImportPlatform.idPC
    End With
    Thanks,
    Shail

    Paul,
    I'm the moderator here, and your response, in my opinion, was out of line. Daniel is a long-time vounteer here, and I see no evidence to suggest anything in your accusations.
    In fact I would say your first post, made some rather egregious presumptions that your problem and that of harooki2 were the same, all evidence to the contrary. In his case he said that the type was visible in overprint preview, which categorically eliminates the possibility that it was set to non-printing in the attibutes panel. Though he might have phrased it better, Daniel was suggesting that had you followed the suggestion  to check overprint preview and reported that the text (or whatever) disappeared, the first suggestion that any of us here would have made would be to check the attributes for non-printing. In fact, that's precisely why he suggested that check in the first response to this thread, to eliminate that as a possibility and quickly establish how complex the problem is.

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Scripts for Exporting Master/Work Rep

    Hi,
    I want to automate the export process and in turn was looking for any scripts for exporting the whole ODI Work/Master Rep. I checked the CLASS objects and we donot have any CLASS names for Repository exports.
    Thanks in advance for any answers..!

    Created for 10g [ http://odiexperts.com/automize-the-backup-using-odi-exports]
    but should work for 11g too :)

  • Export a fla as single swf files

    Hi,
    is there a hint or workaround how to export (save) all frames
    of a FLA file
    as single swf files (like
    you can export a FLA in single JPG files)?
    Would much appreciate if someone has a hint for me.
    Thank you in advanve
    Peter

    Hi,
    that hint does'nt help. The problem is that I want to have
    all frames out of
    one FLA file stored as SINGLE swf file.
    Example: Source: test.fla with 5 frames exported to:
    test_001.swf,
    test_002.swf, test_003.swf ...
    Any idea how to do?
    Kind regards
    Peter
    "Chris Georgenes" <[email protected]> schrieb
    im Newsbeitrag
    news:e5f88q$83h$[email protected]..
    >i may have missed your question - but this is a simple
    File > Publish
    >Settings question - you can also Export as SWF - so not
    sure if you know
    >this and are having problems? there are no work arounds
    to this as it is
    >very basic flash procedure. Please re-explain if i didn't
    understand.
    >
    > ******************************************
    > --> **Adobe Certified Expert**
    > --> www.mudbubble.com
    > --> www.keyframer.com
    >
    >
    >
    >
    > lollipop wrote:
    >> Hi,
    >>
    >> is there a hint or workaround how to export (save)
    all frames of a FLA
    >> file as single swf files (like
    >> you can export a FLA in single JPG files)?
    >>
    >> Would much appreciate if someone has a hint for me.
    >>
    >> Thank you in advanve
    >>
    >> Peter

  • Best Settings for Exporting DVD Footage in a Movie File

    Hello,
    I've been trying to find the best settings for exporting DVD footage into a movie file from Adobe Premiere CS6.
    I recently have been using my Magnavox DVD recorder for recording VHS tapes that I made long ago for shows and various other things, and no matter what, my footage doesn't come out as it needs to be.
    Here's an example of what I did recently with my own settings:
    http://www.youtube.com/watch?v=qFV4sT7rHGs
    I'm not expecting HD footage, I know these are tapes, but I'm playing the raw footage on my Xbox 360, and it looks better than this. I had to directly use the VOB files on the DVD for this, as trying to rip the files into an AVI or any other format with a DVD ripper didn't do anything, in fact it degraded the quality and made the audio not play in Premiere.
    So what would be some good settings for exporting a sequence with DVD footage that is from a VHS into a movie file, preferably one that wouldn't degrade the quality?
    Thanks!

    First, read Why not edit mpeg http://tangentsoft.net/video/mpeg/edit.html to get a general idea of why a VOB makes a very poor source file (which is a renamed MPG, with some other stuff like menu screens)
    Also, Read Bill Hunt on editing a VOB/MPG file http://forums.adobe.com/thread/464549
    Once you have a DVD compliant VOB on your timeline, and understanding that a standalone DVD recorder sometimes plays fast-n-loose with "compliance" per the DVD specification, about all you can do is export to standard or widescreen DV AVI and accept the fact that re-encoding an already compressed file is just not going to give great results

  • Can Adobe Distiller be used for converting all pro/e (3D -2D)  files to pdf format?

    Can Adobe Distiller be used for converting all pro/e (3D -2D)  files to pdf format?

    Acrobat Distiller Server converts Postscript to PDF.

  • I am trying to change the order of one of my audiobooks (media kind: audiobook), but the ID tags are greyed out.  I can't change tags for almost all my audiobooks.  Music files OK. Files are all read/write. Repaired disc perms. OS 10.9.4. ITunes11.4

    I am trying to change the order of one of my audiobooks (media kind: audiobook), but the ID tags are greyed out.  I can't change tags for almost all my audiobooks.  Music files OK. Files are all read/write. Repaired disc perms. OS 10.9.4. ITunes 11.4  I don't have iTunes Match.

    Select all the songs and then Advanced -> Convert ID3 tags.
    http://docs.info.apple.com/article.html?path=iTunesWin/6.0/en/655win.html

  • Wanted to know that can we export the Crystal report in .rtf file

    Hi,
    We are using your u201CCrystalu201D product version 8.5, We have  a valid license .
    Our license number is u201CA6A50-0910000-H410031.
    We are facing some problem while creating the report.
    We want to know that, do you have any functionality to export the report in .rtf format.
    Because here we are not able to export the crystal report in .rtf file.
    If this is possible then please help me.
    Thanks in advance..
    Thanks and Regards,
    Abhineet

    If this is a report creation question, post to the Report Design forum:
    SAP Crystal Reports
    Ludek

  • Script for Exporting 2 Pgs into 1 PDF???

    Hello, I was wondering if anyone can help me. I know there is a script that can export each page of Indesign file as a separate PDF, but is there a script out there to export every two pages of Indesign file.
    Basically what I need to do is create 300 customized documents (based on personal company information) and Export them to a PDF so that I may e-mail one to each company. The document must be two pages, the first page has the personalized (merged) information, but the second page will be exactly the same on all of them.
    Can you tell me how I can do this in Indesign, or if not Indesign, Acrobat? I ran a test with the Data Merge system in Indesign. (I created a .CSV file with 2 columns; Company Name and Company Product and took 5 five companies from the master list to test.)
    After the merge, all the fields populated correctly but I wound up with a 10 page .INDD document. (the odd number pages are the ones with all the "merged" personal info, while all the even number pages exactly the same) What I need now is every 2 pages to be exported as 1 PDF file.
    Is there is an easier way to do this? And if not in Indesign, is there an easy way to extract 2 pages at a time in Acrobat?
    Thank you very much for any help, much appreciated,
    Kevin

    Hi Kevin,<br />Here is another version.<br />copy/paste into a text editor then save as a .jsx and place it in the script folder.<br />The only thing you have to modify is the name of your pdf preset. I thought about a dialog where tou could have switched frome one preset to another easily. But it may much more efficient to just modify the name of the preset. If you want you an also make a copy with another PDF preset then rename it.<br /><br />ad = app.activeDocument;<br />pg=ad.pages;<br />var docpath = ad.filePath;<br />var docname = ad.name;<br />var nb = (Math.round(Number(pg.length/2)))<br />for(i=0; i<nb;i++)<br /><br />{<br />]var pgrgstart = (pg[(2*i)].name);<br /><br />]if(pg[(2*i+1)]==-1)<br /><br />]{<br /><br />]]var pgrgend = pgrgstart;<br /><br />]}<br /><br />]else<br /><br />]{<br /><br />]]var pgrgend = pg[(2*i+1)].name;<br /><br />]}<br /><br />]app.pdfExportPreferences.pageRange = pgrgstart+"-"+pgrgend; <br /><br />]var myPDFExportPreset = app.pdfExportPresets.item("your PDF preset"); <br /><br />b //enter the name of your PDF preset instead of your PDF preset<br /><br />]ad.exportFile(ExportFormat.pdfType, File(docpath+"/"+docname.split(".indd")[0]+"_"+"pg_"+i+"_to_"+(i+1)+".pdf"), false, myPDFExportPreset); <br /><br />}<br /><br />alert("done");

  • Shell script for export and import

    Hi,
    I want to run exp command in background since i need to export 40gb database of other database
    if i won't use & my session will die.
    appreciated any inputs.
    i need to run this line from shell script.
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    bash-2.05$ more export.sh
    #!/bin/sh
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    bash-2.05$ sh export.sh &
    [10] 13352
    bash-2.05$
    Export: Release 8.1.7.0.0 - Production on Fri Dec 4 22:51:09 2009
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    Password: pin
    bash: pin: command not found
    [10]+ Stopped sh export.sh
    input appreciated
    thanks
    Prakash

    Hi,
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    should be
    /oracle/bin/exp pin/pin@voipdbstg file=voip.dmp owner=pin log=voip.log
    Also for running the script is background and you should be able to log out of shell scriptthen run the command in nohup mode.
    $nohup export.sh&
    Regards

Maybe you are looking for