Code: Select all
var file = new File(Folder.desktop + "/Bounds Info.txt");
file.open("e", "TEXT", "????");
$.os.search(/windows/i) != -1 ? file.lineFeed = 'windows' : file.lineFeed = 'macintosh';
file.seek(0,2);
try{
var Name = decodeURI(activeDocument.name);
var b = app.activeDocument.selection.bounds;
var x = b[0].value;
var y = b[1].value;
var w = b[2].value-b[0].value + x;
var h = b[3].value-b[1].value + y;
var unit = b[0].type;
file.writeln('<counter-section front-left="'+x.toFixed(0)+'" front-top="'+y.toFixed(0)+'" front-right="'+w.toFixed(0)+'" front-bottom="'+h.toFixed(0)+'" supply="1" />');
}catch(e){}
file.close();
Code: Select all
<counter-section front-left="257" front-top="347" front-right="361" front-bottom="343" supply="1" />
Heath