mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
Updates, Improvements, and Fixes
* Moved scripts / runner to separate package
allows future replacement with PS Plugin.
* Fixed issues with Refresh and removed "layer" function.
* Added github documentation via godocdown.
* Reduced number of calls to Panic.
* Updated Tests
* Updated documentation.
* Fixed warnings.
* .gitignore now ignores .test and .out files.
This commit is contained in:
22
runner/scripts/getActiveDoc.jsx
Normal file
22
runner/scripts/getActiveDoc.jsx
Normal file
@@ -0,0 +1,22 @@
|
||||
#include lib.js
|
||||
var stdout = newFile(arguments[0]);
|
||||
var doc = app.activeDocument;
|
||||
stdout.writeln(('{"Name": "'+doc.name+'", "Height":'+doc.height+
|
||||
', "Width":'+doc.width+', "ArtLayers": [').replace(/ px/g, ""));
|
||||
|
||||
stdout.writeln(layers(doc.artLayers))
|
||||
stdout.writeln('], "LayerSets": [');
|
||||
function lyrSets(sets, nm) {
|
||||
if (typeof sets === 'undefined')
|
||||
return;
|
||||
for (var i = 0; i < sets.length; i++) {
|
||||
var set = sets[i];
|
||||
var name = nm + set.name + "/";
|
||||
stdout.write('{"Name": "' + set.name + '", "Visible":'+ set.visible +'}');
|
||||
if (i+1 != sets.length)
|
||||
stdout.write(',');
|
||||
}
|
||||
}
|
||||
lyrSets(doc.layerSets)
|
||||
stdout.write(']}');
|
||||
stdout.close();
|
||||
Reference in New Issue
Block a user