mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
Various updates
* Layersets now have bounds. * TextItem is now writeable * Added flush function to writing, for faster debugging.
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
// Opens and returns a file, overwriting new data.
|
||||
function newFile(path) {
|
||||
var f = File(path)
|
||||
if(f.exists)
|
||||
f.remove()
|
||||
f.encoding = "UTF8"
|
||||
f.open("e", "TEXT", "????")
|
||||
f.open("w")
|
||||
return f
|
||||
}
|
||||
|
||||
File.prototype.flush = function() {
|
||||
this.close()
|
||||
this.open("a")
|
||||
};
|
||||
function flush(file) {
|
||||
file.close()
|
||||
file.open("a")
|
||||
}
|
||||
|
||||
|
||||
// Prints an error message.
|
||||
function err(e) {
|
||||
return 'ERROR: ' + e.message + ' at ' + e.fileName + ':' + e.line;
|
||||
@@ -19,6 +27,14 @@ function bounds(lyr) {
|
||||
lyr.bounds[3] + ']]').replace(/ px/g, "");
|
||||
}
|
||||
|
||||
function Undo() {
|
||||
var desc = new ActionDescriptor();
|
||||
var ref = new ActionReference();
|
||||
ref.putEnumerated( charIDToTypeID( "HstS" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Prvs" ));
|
||||
desc.putReference(charIDToTypeID( "null" ), ref);
|
||||
executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
|
||||
}
|
||||
|
||||
/**
|
||||
* The setFormatting function sets the font, font style, point size, and RGB color of specified
|
||||
* characters in a Photoshop text layer.
|
||||
|
||||
Reference in New Issue
Block a user