mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
V2.0 update
## Features ### Open * Now returns the activeDocument after opening the file. ### JSLayer() * Removed semicolon from output. ### Document * Added FullName() which returns path to the .psd file. * Changed Filename() to DumpFile(), as Filename was misleading. * Dump function now saves the file as well, to help reduce the frequency of de-syncs. * Dump function now saves json files alongside the .psds instead of in a separate data folder- encountered issues when using the package as a module in go 1.11beta2. * Added Save() ## Testing * Added TestDocument_Save * Added TestDocument_Dump ## Misc. * Renamed pkgpath to pkgPath, to better fit go's standards. ## Fixes * DoAction now runs correctly.
This commit is contained in:
5
runner/scripts/SetName.jsx
Normal file
5
runner/scripts/SetName.jsx
Normal file
@@ -0,0 +1,5 @@
|
||||
#include lib.js
|
||||
var stdout=newFile(arguments[0]);
|
||||
var obj=eval(arguments[1]);
|
||||
obj.name=arguments[2];
|
||||
stdout.close();
|
||||
@@ -1,5 +1,6 @@
|
||||
' Runs an action with the given name (Argument 1) from the given set (Argument 0).
|
||||
set appRef = CreateObject("Photoshop.Application")
|
||||
' No dialogs'
|
||||
' No dialogs.
|
||||
dlgMode = 3
|
||||
|
||||
set desc = CreateObject( "Photoshop.ActionDescriptor" )
|
||||
|
||||
@@ -4,8 +4,6 @@ Set appRef = CreateObject("Photoshop.Application")
|
||||
if wScript.Arguments.Count = 0 then
|
||||
wScript.Echo "Missing parameters"
|
||||
else
|
||||
' wScript.Echo wScript.Arguments(0)
|
||||
' wScript.Echo wScript.Arguments(1)
|
||||
path = wScript.Arguments(0)
|
||||
args = wScript.Arguments(1)
|
||||
error = appRef.DoJavaScriptFile(path, Split(args, ",,"))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include lib.js
|
||||
var stdout = newFile(arguments[0]);
|
||||
var doc = app.activeDocument;
|
||||
stdout.writeln(('{"Name": "'+doc.name+'", "Height":'+doc.height+
|
||||
stdout.writeln(('{"Name": "'+doc.name+'", "FullName": "'+doc.fullName+'", "Height":'+doc.height+
|
||||
', "Width":'+doc.width+', "ArtLayers": [').replace(/ px/g, ""));
|
||||
|
||||
stdout.writeln(layers(doc.artLayers))
|
||||
|
||||
Reference in New Issue
Block a user