placing PDF files on separate pages INDESIGN

Now that I have some time… i have my script opening an existing file, creating a box on page one, putting a PDF into it, then going on to page 2 and page 3 doing the same thing on each one.

my results are not what I expect. I put the display dialogs in for troubleshooting.

the 258809art.pdf does appear on page 1, but the 258809bc.pdf also appears on page 1 and 258809sheet.pdf appears on page 2. why don’t the 2nd and 3rd PDFs appear on pages 2 and 3 respectively?

thanks
david

tell application "Adobe InDesign CS6"
	activate
	
	open file "macintosh HD:Users:DAVID:Desktop:testpdf.indd"
	tell page 1 of document 1
		set myBox to make rectangle with properties {geometric bounds:{0.1, 0.1, 4, 8.5}, stroke weight:"0"}
		tell myBox
			place file "G1:CentralPDFProofs:258809:258809art.pdf"
		end tell
	end tell
	display dialog "OK"
	tell page 2 of document 1
		set myBox to make rectangle with properties {geometric bounds:{0.1, 0.1, 5, 8.5}, stroke weight:"0"}
		tell myBox
			place file "G1:CentralPDFProofs:258809:258809bc.pdf"
		end tell
	end tell
	display dialog "OK"
	tell page 3 of document 1
		set myBox to make rectangle with properties {geometric bounds:{0.1, 0.1, 11, 8.5}, stroke weight:"0"}
		tell myBox
			place file "G1:CentralPDFProofs:258809:258809sheet.pdf"
		end tell
	end tell
	
	
end tell

Hi, David. I can tell from the result that the ruler is set to be relative to the spread on your machine, but it needs to be relative to the page. Place this on the line after the open command. I don’t have CS6, but this”or some syntactical variant”should make the necessary adjustment.

	tell document 1 to set view preferences's ruler origin to page origin

nope… that didn’t solve it.

It doesn’t seem like that would be a solution, since it’s placing the pdfs, on p1, p1 and p2, instead of p1, p2, p3

Your page 1 and 2 are, apparently, side-by-side, and the identical X, Y coordinates {0.1,0.1} being provided by the geometric bounds are determining placement. If you manually check your document preferences, to what is the ruler origin set?

FYI, the script works as expected in CS4. I have my Units & Increments preference set to Origin: Page, with the 0, 0 point at the top left of each page.

manually, in my preferences, the origin is set to page.
i could put the pages NOT side by side and try that… that would just mean i have to scroll up and down between the pages.

any other suggestions so that I could keep them side by side?

Well… I went around the problem… I added 8.5" to the positions where needed to get the boxes where they belong. Very less than elegant solution, but it works. I would still like to know how to do this correctly.

thanks
david

Run my code, below. There should be a difference between the placement on page three. If there’s no visual difference between the two files, there might be a bug in CS6, and the modification to the bounds is then an appropriate workaround. You should also confirm the ruler settings for “testpdf.indd”. Both document and application have this property, and it would be easy to confuse them.

tell application "Adobe InDesign CS6"
	
	tell (make document)
		set document preferences's pages per document to 3
		set view preferences's ruler origin to spread origin
		repeat with pageNum from 1 to 3
			tell page pageNum to make rectangle with properties {geometric bounds:{0, 0, 5, 5}}
		end repeat
	end tell
	
	tell (make document)
		set document preferences's pages per document to 3
		set view preferences's ruler origin to page origin
		repeat with pageNum from 1 to 3
			tell page pageNum to make rectangle with properties {geometric bounds:{0, 0, 5, 5}}
		end repeat
	end tell
	
end tell

Hmmmm… that does what we expect… however, it really is better for me to have my pages side by side across a 3 page spread. It’s much faster just to scroll a little to the right, instead of scrolling down 3 pages.

I’m almost there…

david