Probably not like you say, but maybe you could achieve it in some other way. So if you mean you have a transparent layer with one just one pixel (or one solid block), you can find out coords by trimming it twice and noting how the dimensions change. So create an empty doc of same size, duplicate your layer there and trim it to find out x and y. Then you can keep running current script with those params or maybe eval a new script. As an example see
trimDocument: function (doc) {
if (doc) {
var extents = {}
var orig_w = Photoshop.getDocumentWidth(doc)
var orig_h = Photoshop.getDocumentHeight(doc)
doc.trim(TrimType.TRANSPARENT, false, true, true, false)
var x = orig_w - Photoshop.getDocumentWidth(doc)
var y = orig_h - Photoshop.getDocumentHeight(doc)
doc.trim(TrimType.TRANSPARENT, true, false, false, true)
var h = Photoshop.getDocumentHeight(doc)
var w = Photoshop.getDocumentWidth(doc)
return { x: x, y: y, height: h, width: w }
}
},
... View more