From 36ccc2624393d472a63e09dcdb9c043a4b218706 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 5 Feb 2018 21:28:43 -0500 Subject: [PATCH] documentation updates --- ps.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ps.go b/ps.go index ef271f1..e0bd288 100644 --- a/ps.go +++ b/ps.go @@ -1,7 +1,7 @@ -// Package ps lets you manipulate Adobe Photoshop (CS5) from go. +// Package ps creates an interface between Adobe Photoshop (CS5) and go. // This is primarily done by calling VBS/Applescript files. // -// Currently only works on windows +// Currently only works on windows. package ps import ( @@ -39,8 +39,9 @@ func Start() error { } // Open a file. -func Open(path string) ([]byte, error) { - return run("open", path) +func Open(path string) error { + _, err := run("open", path) + return err } // Close the active document. @@ -49,9 +50,13 @@ func Close() error { return err } -// Quit photoshop with save status. -func Quit(save int) ([]byte, error) { - return run("quit", string(save)) +// Quits photoshop. +// +// There are 3 valid values for save: 1 (psSaveChanges), 2 (psDoNotSaveChanges), +// 3 (psPromptToSaveChanges). +func Quit(save int) error { + _, err := run("quit", string(save)) + return err } func Js(path string, args ...string) ([]byte, error) { @@ -79,6 +84,11 @@ func Js(path string, args ...string) ([]byte, error) { return cmd, err } +// Wait provides the user a message, and halts operation until the user +// signals that they are ready (by pushing enter). +// +// Useful for when you need to do something by hand in the middle of an +// automated process. func Wait(msg string) { fmt.Print(msg) var input string