saving catalog name in Iview

Hi have a a script I’m trying to have a iview catalog made and saved with a name based on the folder name that its cataloging.
this is the part I cant get to work.


set theParentFolder to choose folder

tell application "Finder"
	set filePath to theParentFolder as alias
	
	set Catalogue to name of filePath
	
	tell application "iView MediaPro"
		open ((theParentFolder) as alias)
		delay 5
		set name of catalog -1 to ((characters 1 thru -1 of Catalogue) as text)
		save Catalogue
		--in file theParentFolder
		close catalog 1
	end tell
end tell

Thanks in advance