Advertisement
Guest User

Export Layer XY and names. Illustrator

a guest
Nov 9th, 2012
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (app.documents.length > 0)
  2.  
  3. {
  4. var doc = app.activeDocument;
  5. var x;
  6. var y;
  7. var t;
  8. app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
  9. var count = doc.layers.length;
  10. var out_txt="";
  11.  
  12. for ( var i = 0; i < count; ++i)
  13. {
  14. doc.activeLayer = doc.layers[i];
  15. doc.layers[i].hasSelectedArtwork = true;
  16. }
  17.  
  18.  
  19. for ( var i = 0; i < count; ++i)
  20. {
  21. x = doc.selection[i].position[0];
  22. y = doc.selection[i].position[1]*(-1);
  23. out_txt += doc.layers[i].name + ";;x=" + x.toFixed(0) + ";;y=" + y.toFixed(0) + "\n";
  24. }
  25.  
  26. t = doc.layers[0].textFrames.add();
  27.         t.contents = out_txt;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement