Article View: adobe.scripting.indesign
Article #9740Re: Release anchored objects of a story
From: Dave_Saunders
Date: Fri, 21 Jul 2006 19:23
Date: Fri, 21 Jul 2006 19:23
18 lines
1244 bytes
1244 bytes
Here's what I have now:
Object.prototype.releaseAnchored = function() {
if (this.parent.constructor.name != "Character") throw "Object is neither anchored nor inline"
this.select(SelectionOptions.replaceWith);
this.parent.parentStory.recompose();
var myBounds = this.geometricBounds;
app.cut();
app.paste();
app.selection[0].move([myBounds[1], myBounds[0]]);
return app.selection[0]
}
Out with "Holy cow!" in with a more circumspect error message. And I've added recomposing the parent story to make sure the geometric bounds are good.
By the way, Paste in Place has the same problem in the UI.
Dave
Technical Details
Message-ID:
<3bc0fe9c.7@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossingReferences:
<3bc0fe9c.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,26971fcf4ed8261a X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: Release anchored objects of a story Message-ID: <3bc0fe9c.7@webcrossing.la2eafNXanI> Date: Fri, 21 Jul 2006 12:23:36 -0700 References: <3bc0fe9c.-1@webcrossing.la2eafNXanI> Lines: 21 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing