Hi,
I’m having a bit of a kerfuffle. I wrote a script that selects paragraphs of text frames within groups. Without putting the result into a list I get the correct paragraphs. However, when I try to put each paragrah into a list, I get a weird result. The list winds up having 8 repetitions of the first paragraph, followed by the rest of the paragraphs.
Here is the script
tell application "Adobe InDesign CS3"
tell active document
set myCreditList to {}
set myPages to every page
repeat with j from 1 to count of myPages
tell page j
set myGroups to every group
repeat with aGroup in myGroups
set groupItemList to (every page item of aGroup whose class is text frame)
repeat with anItem in groupItemList
set paraLength to number of paragraphs in anItem
repeat with i from 1 to paraLength
if name of applied paragraph style of paragraph i of anItem is "08_ImageCredit" then
set actualParagraph to paragraph i of anItem
set theCredit to (characters 8 thru -1 of actualParagraph as text) & "; p." & (j as text)
end if
end repeat
end repeat
end repeat
end tell
copy theCredit to end of myCreditList
end repeat
end tell
display dialog myCreditList
end tell
end tell
the display dialog returns an error and the event log shows that myCreditList is:
{“© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “© Terry G. McCrea/Smithsonian Institution; p.1”, “Copyright Nick Catford from Subterranea Britannica web site, www.subbrit.org.uk; p.9”, " Mortadelo2005/creativecommons.org; p.10", “SqueakyMarmot/creativecommons.org; p.11”, “Omer Simkha/creativecommons.org ; p.12”}
What can cause the script to enter the first pic 8 times?
Please help!