try
{
var
tf=app.activeDocument.textFrames[0].nextFrame;
alert(tf);
}
catch
(e){
alert(
"これより先のフレームはありません"
);