home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip Temmuz 2004.iso / program / code / Adobe Illustrator CS Tryout / data1.cab / Program_Files / Presets / Scripts / ExportDocsAsFlash.js < prev    next >
Encoding:
Text File  |  2004-01-07  |  929 b   |  35 lines

  1. // save all open documents as flash documents
  2.  
  3.  
  4.  
  5. //$.bp();    //    Uncomment this line to cause the script to be run in the JavaScript debugger window.
  6.  
  7.  
  8.  
  9. numDocuments = documents.length;
  10.  
  11.  
  12.  
  13. for ( i = 0 ; i < numDocuments; i++)
  14.  
  15. {
  16.  
  17.     aDocument = documents[i];
  18.  
  19.     theDocumentName = aDocument.name;
  20.  
  21.     
  22.  
  23.     flashOptions = new ExportOptionsFlash();
  24.  
  25.  
  26.  
  27.     flashOptions.jpegQuality = 10;
  28.  
  29.     flashOptions.curveQuality = 10;
  30.  
  31.     flashOptions.replacing = SaveOptions.SAVECHANGES;
  32.  
  33.  
  34.  
  35.     docPath = aDocument.path;
  36.  
  37.     docPathStr = docPath.toString();
  38.  
  39.  
  40.  
  41.     if (docPathStr.length > 1)
  42.  
  43.     {
  44.  
  45.         documentPath = docPath + "/" + aDocument.name;
  46.  
  47.     }
  48.  
  49.     else
  50.  
  51.     {
  52.  
  53.         // This is a brand new file and doesn't have a path yet,
  54.  
  55.         // so put it in the illustrator application folder.
  56.  
  57.         documentPath = path + "/" + aDocument.name;
  58.  
  59.     }
  60.  
  61.  
  62.  
  63.     theFile = new File(documentPath);
  64.  
  65.     aDocument.exportFile(theFile, ExportType.FLASH, flashOptions);
  66.  
  67. }
  68.  
  69.