Hi experts, my script like this: function movecashline() { var mMsg = {title: "move frames"}, cMH, cMV, cZP, cRO; cash(); function cash () { var mTarget = checkSelection().everyItem().getElements(), mDoc, cMPages, cPages, cPage; mMsg.funName = "Main"; while (mDoc = mTarget.pop()) { doRulesUp(mDoc); cMPages = mDoc.masterSpreads.everyItem().pages.everyItem().getElements(); cPages = mDoc.pages.everyItem().getElements(); while (cPage = cMPages.pop()) moveBar (cPage); while (cPage = cPages.pop()) moveBar (cPage); doRulesDown(mDoc); } } function moveBar (mPage, mStyle) { var cTopMargin = mPage.marginPreferences.top, cBottomMargin = mPage.marginPreferences.bottom, cBounds = mPage.bounds, cPI, cGB, cStyleName = "footer", cPIs = mPage.textFrames.everyItem().getElements(); while (cPI = cPIs.pop()) { if (!cPI.hasOwnProperty ("texts")) continue; if (!cPI.texts[0].characters.length) continue; if (!cPI.texts[0].appliedParagraphStyle.name.match(/^footer$/i)) continue; cGB = cPI.geometricBounds; if (cGB[0] > cBounds[2] - cBottomMargin) cPI.move([cGB[1], cBounds[2] + 25]); else cPI.move([cGB[1], -(cGB[2] - cGB[0]) - 25]); } } function doRulesUp(cDoc) { with (cDoc.viewPreferences) { cMH = app.activeDocument.viewPreferences.horizontalMeasurementUnits; cMV = app.activeDocument.viewPreferences.verticalMeasurementUnits; cRO = app.activeDocument.viewPreferences.rulerOrigin; horizontalMeasurementUnits = MeasurementUnits.POINTS; verticalMeasurementUnits = MeasurementUnits.POINTS; rulerOrigin = RulerOrigin.PAGE_ORIGIN; } cZP =cDoc.zeroPoint, cDoc.zeroPoint = [0,0]; } function doRulesDown(cDoc) { with (cDoc.viewPreferences) { horizontalMeasurementUnits = cMH; verticalMeasurementUnits = cMV; rulerOrigin = cRO; } cDoc.zeroPoint = cZP; } function checkSelection () { mMsg.funName = "Check Selection"; if ( !app.documents.length) { mMsg.line = $.line - 1; mMsg.text = "No target detected.\nOpen any doc."; errorClose (mMsg); } return app.documents; // } } aim to move the text frame, which has text and applied to para style "footer". but it pop up error on this case: if there is threaded frames, like this: and the fame is empty the error says: error from this line: if (!cPI.texts[0].characters.length) continue; reason: Object is invalid could some one tell how to fix, please. thanks regard John
... View more