mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
documentation updates
This commit is contained in:
24
ps.go
24
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.
|
// This is primarily done by calling VBS/Applescript files.
|
||||||
//
|
//
|
||||||
// Currently only works on windows
|
// Currently only works on windows.
|
||||||
package ps
|
package ps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -39,8 +39,9 @@ func Start() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open a file.
|
// Open a file.
|
||||||
func Open(path string) ([]byte, error) {
|
func Open(path string) error {
|
||||||
return run("open", path)
|
_, err := run("open", path)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the active document.
|
// Close the active document.
|
||||||
@@ -49,9 +50,13 @@ func Close() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quit photoshop with save status.
|
// Quits photoshop.
|
||||||
func Quit(save int) ([]byte, error) {
|
//
|
||||||
return run("quit", string(save))
|
// 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) {
|
func Js(path string, args ...string) ([]byte, error) {
|
||||||
@@ -79,6 +84,11 @@ func Js(path string, args ...string) ([]byte, error) {
|
|||||||
return cmd, err
|
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) {
|
func Wait(msg string) {
|
||||||
fmt.Print(msg)
|
fmt.Print(msg)
|
||||||
var input string
|
var input string
|
||||||
|
|||||||
Reference in New Issue
Block a user