Article View: adobe.scripting.indesign
Article #17585Re: Req. For Help: Create new text boxes from clipboard
From: Michael Allison
Date: Thu, 29 May 2003 22:58
Date: Thu, 29 May 2003 22:58
28 lines
2294 bytes
2294 bytes
Hey Dave,
Thanks for the info. I often times know what I want the script to do but just don't know how to write it. One more question, I promise...at least for this thread. =8^)
Here is the final script that you helped me put together. I'm getting an error and am not sure why. I put the error at the end of this post. It works when I hard code the Paragraph Style but not when it is picked from the list.
set coords to {0, 3, 63, 19}
set gap to 3
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 LabelParaStyle to (choose from list settingsfiles with prompt "Choose settings:")
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
--> InDesign 2.0.2 got an error: Can't set applied paragraph style of paragraph 1 of text frame id 504 of page id 119 of spread id 114 of document "Untitled-19" to paragraph style {"[No paragraph style]"} of document 1.
Technical Details
Message-ID:
<1de95236.9@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!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-29 16:08:08 PST From: "Michael Allison" <allisonm@executiveboard.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!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.9@WebX.la2eafNXanI> Date: Thu, 29 May 2003 15:58:04 -0700 References: <1de95236.-1@WebX.la2eafNXanI> Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit