Article View: adobe.scripting.indesign
Article #19584Re: adding a text frame inside a text frame
From: Olav Kvern
Date: Fri, 06 Dec 2002 21:47
Date: Fri, 06 Dec 2002 21:47
26 lines
1665 bytes
1665 bytes
Matt--
You're *way* better off placing a dummy graphic, deleting the graphic (which leaves the inline frame), and then setting the frame's content type to text.
If you use copy/paste, you have to worry about selecting objects, and you'll find that this is a very fragile. What if you're trying to select an object in overset text? Or on another spread? You'll get an error and your script will sop running. Instead, try something like this:
--Assumes you have a document open and that the document contains at least one story
set myFile to choose file
tell application "InDesign 2.0.1"
tell character 1 of story 1 of active document
set myGraphic to place myFile
set myFrame to parent of myGraphic
tell myGraphic to delete
set content type of myFrame to text type
set text of myFrame to "This is an inline frame."
end tell
end tell
Thanks,
Ole
Technical Details
Message-ID:
<1de6e43b.2@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de6e43b.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,1b85a7ac7e50be86 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-06 14:07:56 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: adding a text frame inside a text frame Message-ID: <1de6e43b.2@WebX.la2eafNXanI> Date: Fri, 6 Dec 2002 13:47:23 -0800 References: <1de6e43b.-1@WebX.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit