from textframe import TextFrame

def adjustFrameHeight(height,name,iname):
	text  = "    " + name + "\n"
	text += "\n\n    BEFORE:\n\n\n"
	frame = TextFrame(scribus,name)
	text += frame.getInfo()
	frame.setHeight(height)
#	frame.adjustHeightToText()
	frame.ajdustLineSpacingToHeight()
	text += "\n\n    AFTER:\n\n\n"
	text += frame.getInfo()
	info = TextFrame(scribus,iname)
	info.setText(text)

openDoc("textframe_height.sla")

setUnit(UNIT_MM)

adjustFrameHeight( 257 , "TextFrameLeft"  , "InfoLeft"  )
adjustFrameHeight( 257 , "TextFrameRight" , "InfoRight" )

infoPage = TextFrame( scribus , "InfoPage" )
infoPage.setText( infoPage.getPageInfo() )

deselectAll()

saveDocAs("textframe_height_ADJUSTED.sla")

zoomDocument(-100)

