home *** CD-ROM | disk | FTP | other *** search
/ com!online 2002 July / com!online0702.iso / software / livemotion / DATA1.CAB / Automation / Scripts / Convert All Into Objects.js < prev    next >
Encoding:
Text File  |  2002-05-13  |  1.9 KB  |  54 lines

  1. /***************************************************************
  2. ADOBE SYSTEMS INCORPORATED 
  3. Copyright 2002 Adobe Systems Incorporated 
  4. All Rights Reserved 
  5.  
  6. NOTICE:  Adobe permits you to use, modify, and distribute this 
  7. file in accordance with the terms of the Adobe license agreement 
  8. accompanying it.  If you have received this file from a source 
  9. other than Adobe, then your use, modification, or distribution
  10. of it requires the prior written permission of Adobe. 
  11. ***************************************************************/
  12. /***************************************************************
  13. Author: Henry Lee
  14. ***************************************************************/
  15.  
  16. /***************************************************************
  17.  
  18. This script is a recursive function that will take any covertable
  19. (i.e. PhotoShop PSD or Illustrator AI) object and continually 
  20. break them down until only the objects remain.  This simplifies
  21. the task of having to repeatedly execute the Convert to Objects
  22. command.
  23.  
  24. ***************************************************************/
  25.  
  26. /***************************************************************
  27. To change the behavior of this script, make your changes below
  28. ***************************************************************/
  29.  
  30. comp = application.currentComposition;
  31. objs = comp.selection;
  32.  
  33. for (var i=0; i<objs.length; i++) {
  34.   convertIntoObjs(objs[i]);
  35. }
  36.  
  37.  
  38. /***************************************************************
  39. DO NOT EDIT BELOW THIS LINE
  40. ***************************************************************/
  41.  
  42. function convertIntoObjs(object) {
  43.     var i;
  44.     var convertedArray;
  45.     convertedArray = object.convertIntoObjects();
  46.     if ((convertedArray.length>1)||(convertedArray[0] != object)) {
  47.       for (i=0;i<convertedArray.length;i++) {
  48.         convertIntoObjs(convertedArray[i]);
  49.       }
  50.     }
  51. }
  52.  
  53.  
  54.