Article View: adobe.scripting.indesign
Article #17498Re: Req. For Help: Create new text boxes from clipboard
From: Michael Allison
Date: Fri, 30 May 2003 14:17
Date: Fri, 30 May 2003 14:17
24 lines
2180 bytes
2180 bytes
Thanks for all your help Dave. I finally figured it out. I needed to tell the choose from list statement to save as a string. Everything now works great and you now have a new fan. Below is the final script for anyone who is interested. I learned a ton from this exercise. Cheers. Michael
set coords to {0, 3, 63, 19}
set gap to 0.5
set theText to the clipboard as string
set theLabels to every paragraph of theText
tell application "InDesign 2.0.2"
activate
set settingsfiles to name of every paragraph style of document 1
set settingsfiles to rest of settingsfiles
set the LabelParaStyle to (choose from list settingsfiles with prompt "Choose a style:") as string
if the LabelParaStyle is false then return "user cancelled"
repeat with n from 1 to (count theLabels) - 1
if contents of item n of theLabels is not "" then
set item 1 of coords to (item 1 of coords) + gap
tell active spread of active window
set myFrame to make text frame with properties {visible bounds:coords}
end tell
set contents of insertion point 1 of myFrame to item n of the theLabels
set applied paragraph style of paragraph 1 of myFrame to paragraph style LabelParaStyle of document 1
fit myFrame given frame to content
end if
end repeat
end tell
Technical Details
Message-ID:
<1de95236.13@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de95236.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,3ff73acf5baeb89 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-05-30 07:37:57 PST From: "Michael Allison" <allisonm@executiveboard.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Req. For Help: Create new text boxes from clipboard Message-ID: <1de95236.13@WebX.la2eafNXanI> Date: Fri, 30 May 2003 07:17:11 -0700 References: <1de95236.-1@WebX.la2eafNXanI> Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit