🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8336

[AS, CS2] Override all page items

#8336
From: Philip_Regan
Date: Wed, 18 Oct 2006 15:43
74 lines
2796 bytes
Why doesn't this work? The chunk of code below my sig goes through the override commands without error, but when it goes to place an image in one of the page items, it returns the error "Can't get rectangle \"ImageContentRect\" of page id 6512 of spread id 6507 of document \"49214_DSGN_Template.indd\" and when I go to the page none of items are overridden.

On a side note, I've tried every variation of this that I can think of and *nothing* works.
[code]
repeat with newPageItems from 1 to (get count of page items in page spreadPage of master spread 1)
     override page item newPageItems of page spreadPage of master spread 1 destination page page lastPage
end repeat
[/code]

This used to be so simple...

Thanks
--
Philip
pregan <at> gmail

[code]
tell application "Adobe InDesign CS2"
		activate

		open (TheTemplate as alias)

		tell document 1

			set imageCount to get count of items in ImageName
			set theMaster to master spread 1
			tell theMaster
				set itemCount to (get count of items)
			end tell

			repeat with i from 2 to imageCount

				set MadePage to make page at end
				set MadePage to page i

				tell MadePage

					set itemCount to (get count of page items)
					repeat with p from 1 to itemCount
						set thisPageItem to page item p
						tell thisPageItem
							override destination page page i
						end tell
					end repeat

					--prep image file path
					set currImage to (item i of ImageName)
					set imageToProcess to TheImages & currImage

					--ImageContentRect = ImageName{i}
					set theRectangle to rectangle "ImageContentRect"
					tell theRectangle
						set content type of theRectangle to graphic type
						place (imageToProcess as alias)
						fit given proportionally
						fit given center content
					end tell

					--ChapterTitleTextFrame = chapterTitleList{i}
					tell rectangle "ChapterTitleTextFrame"
						set contents to item i of chapterTitleList
					end tell

					--CaptionFrame = FigureNumberList{i} & CaptionList{i}
					tell rectangle "CaptionFrame"
						set contents to (item i of chapterTitleList & ": " & item i of CaptionList)
					end tell

				end tell
			end repeat

		end tell
	end tell
[\code]
Technical Details
Message-ID: <3bc2023d.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,b4ff63a1be85a6ed,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Philip_Regan@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: [AS, CS2] Override all page items
Message-ID: <3bc2023d.-1@webcrossing.la2eafNXanI>
Date: Wed, 18 Oct 2006 08:43:56 -0700
Lines: 82
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing