Aligning two layers by moving only one
I'm attempting to vertically align two layers (1 text-based, 1 graphic) by only moving the text. I have tried locking the position of one layer, but then the align command isn't available. I then tried this with the following script, which does work up until the text-based layer is a certain length, at which point I get the following error. It seems that the length limit that causes the error is whenever the text is longer than the document, but why would this affect its vertical (y-position) aligning?
Any way to get around this, and position the text at a given y-coordinate, or aligned with another layer, regardless of text length? Thanks!

app.preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument;
var yPos = 1500;
doc.activeLayer.translate(undefined, yPos- doc.activeLayer.bounds[1].value);
