mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
* Made Refresh() more robust - when an error is encountered, the layer(set) is reloaded automatically. * JS errors are now output to console instead of alerts.
14 lines
494 B
JavaScript
14 lines
494 B
JavaScript
#include lib.js
|
|
app.displayDialogs=DialogModes.NO
|
|
var stdout = newFile(arguments[0]);
|
|
var lyr = eval(arguments[1]);
|
|
stdout.write(('{"Name":"' + lyr.name + '","Bounds":[[' + lyr.bounds[0] + ',' +
|
|
lyr.bounds[1] + '],[' + lyr.bounds[2] + ',' +
|
|
lyr.bounds[3] + ']],"Visible":' + lyr.visible+',"Text":').replace(/ px/g, ""));
|
|
if (lyr.kind == LayerKind.TEXT) {
|
|
stdout.write('"'+lyr.textItem.contents.replace(/\r/g, "\\r")+'"');
|
|
}
|
|
else
|
|
stdout.write(null)
|
|
stdout.writeln('}')
|
|
stdout.close(); |