fit page in window InDesign CS6

omg… scripting is much more complicated in Indesign than in Quark. I have a script in quark that will open a pre-existing document and import some PDFs into specifically sized and placed graphic boxes. on 3 different pages. Is there any chance that someone can help me out in converting this to Indesign CS6?

I can’t even figure out how to write the correct command to fit the damn page in the window… argggghh.

david


	tell application "QuarkXPress"
		
		tell application "Finder" to open ("Macintosh HD:Users:DAVID:desktop:PDF-GENERIC")
		activate
		tell front document
			set properties to {bounds:{40, 40, 1200, 1200}}
			set properties to {view scale:{fit page in window}, guides showing:{false}}
			tell page 1
				try
					make picture box at beginning with properties {polygon points:{{".93\"", "0\""}, {".93\"", "2.15\""}, {"0\"", "2.15\""}, {"0\"", "8.5\""}, {"4\"", "8.5\""}, {"4\"", "0\""}}}
					tell picture box 1
						set image 1 to file aArtPdf
					end tell
				on error
					display dialog "Can't Find ART PDF"
				end try
			end tell
			tell page 2
				try
					make picture box at beginning with properties {polygon points:{{".93\"", "0\""}, {".93\"", "2.15\""}, {"0\"", "2.15\""}, {"0\"", "8.5\""}, {"5\"", "8.5\""}, {"5\"", "0\""}}}
					tell picture box 1
						set image 1 to file aBCPdf
					end tell
				on error
					display dialog "Can't Find BC PDF"
				end try
			end tell
			tell page 3
				try
					make picture box at beginning with properties {bounds:{"0\"", "0\"", "11\"", "8.5\""}}
					tell picture box 1
						set image 1 to file aSheetPdf
					end tell
				on error
					display dialog "Can't Find SHEET PDF"
				end try
			end tell
		end tell
		save document 1 in file ("G1:Art Department 2:Work Files2:" & destFolder & ":" & jobNum & "proof") version vers current without template
	end tell
end try


If you are placing images in rectangular frames, you don’t need to use Polygon points, “geometric bounds” works. If you are making polygons you’ll need to use multiple points.
You also don’t need to use “at beginning”.
ID can do a heck of a lot more, so things will seem more complicated at first.
Here’s something to get you started.

tell myPage
set myBox to make rectangle with properties {geometric bounds:{myY1, myX1, myY2, myX2}, stroke weight:“1”, stroke color:“Black”, stroke alignment:inside alignment}

tell myBox
place file theFilePath
end tell
try
fit myBox given proportionally
fit myBox given center content
end try

zoom window 1 of someDoc given fit page

I will give that a try. I do need to make a polygonal shape because I need to cut out a logo that is in the imported document. We could simply put a mask over it, but in the past, I have seen where the logo blinks through under the mask for an instant.
thanks
david