Problem with script

I’m having an issue with a script, it worked great in CS4, but it is having troubles in CS5.5. I cannot get it to align the pdf center in the image box. Any help would be greatly appreciated. Thank you


set fitting alignment of frame fitting options to center anchor



tell application "Finder"
	
	set myFolder to (choose folder with prompt "Select the folder containing the PDFs you want to convert")
	set myFiles to count every item of folder myFolder
	set PDF_List to every item of folder myFolder as alias list
	
	set folder_path to (choose folder with prompt "Select folder to Save PDF files") as string
	
	
	tell application "Adobe InDesign CS5.5"
		activate
		set pdf_style to name of PDF export presets
		set export_style to (choose from list pdf_style with prompt "Select PDF Export Preset") as string
		
		repeat with i from 1 to myFiles
			activate
			set page number of PDF place preferences to 2
			set FormDoc to make document
			tell document preferences of FormDoc
				set {page height, page width} to {"10.875 in", "9 in"}
			end tell
			tell FormDoc
				try
					set LayerName to layer "Image layer" of FormDoc
				on error
					set LayerName to make layer with properties {visible:true, locked:false, name:"PDF"}
					delete layer 2
				end try
				delete color "C=100 M=0 Y=0 K=0"
				delete color "C=0 M=0 Y=100 K=0"
				delete color "C=0 M=100 Y=0 K=0"
				delete color "C=15 M=100 Y=100 K=0"
				delete color "C=75 M=5 Y=100 K=0"
				delete color "C=100 M=90 Y=10 K=0"
				
				tell FormDoc
					set the_frame to make text frame
					set the geometric bounds of the_frame to {"0 in", "0 in", "10.875 in", "9 in"}
					tell the_frame
						set fitting alignment of frame fitting options to center anchor
						
						set pdf_page to place (item i of PDF_List) on the_frame
						set newName to text 1 thru -5 of name of (info for item i of PDF_List)
						
						set PDF_name to folder_path & newName & "_ WEB" & ".pdf"
						tell FormDoc
							export format PDF type to PDF_name using export_style without showing options
							close FormDoc saving no
						end tell
					end tell
				end tell
			end tell
		end repeat
	end tell
	beep
	display dialog "Your PDFs are Done" buttons {"Done"} default button 1
end tell

gidday fishheadtw

try this out



tell application "Finder"
	
	set myFolder to (choose folder with prompt "Select the folder containing the PDFs you want to convert")
	set myFiles to count every item of folder myFolder
	set PDF_List to every item of folder myFolder as alias list
	
	set folder_path to (choose folder with prompt "Select folder to Save PDF files") as string
	
	
	tell application "Adobe InDesign CS5.5"
		activate
		set pdf_style to name of PDF export presets
		set export_style to (choose from list pdf_style with prompt "Select PDF Export Preset") as string
		
		repeat with i from 1 to myFiles
			activate
			set page number of PDF place preferences to 2
			set FormDoc to make document with properties {document preferences:{page width:"9 in", page height:"10.875 in"}}
			
			tell FormDoc
				try
					set LayerName to layer "Image layer" of FormDoc
				on error
					set LayerName to make layer with properties {visible:true, locked:false, name:"PDF"}
					delete layer 2
				end try
				delete color "C=100 M=0 Y=0 K=0"
				delete color "C=0 M=0 Y=100 K=0"
				delete color "C=0 M=100 Y=0 K=0"
				delete color "C=15 M=100 Y=100 K=0"
				delete color "C=75 M=5 Y=100 K=0"
				delete color "C=100 M=90 Y=10 K=0"
				
				
				set the_frame to make text frame with properties {geometric bounds:{"0 in", "0 in", "10.875 in", "9 in"}, stroke weight:0, fill color:"None"}
				set pdf_page to place (item i of PDF_List) on the_frame
				fit rectangles of active layer given center content
				
				set newName to text 1 thru -5 of name of (info for item i of PDF_List)
				set PDF_name to folder_path & newName & "_ WEB" & ".pdf"
				export format PDF type to PDF_name using export_style without showing options
				close FormDoc saving no
				
			end tell
		end repeat
	end tell
	beep
	tell application "Finder"
		activate
		display dialog "Your PDFs are Done" buttons {"Done"} default button 1
		activate
	end tell
end tell

Thank you Budgie that worked out great