Scripting Title Change for Container Component

I’ve seen some threads about accessing and setting border properties.
Unfortunately they all seem to focus on the Panel Border type of border.
I’m trying to create a feature to allow a user to input a caption to the printing of a chart and my idea was to use the Container to do that. When the print button is pressed an input dialog would accept the caption and the set the title of the container to that caption. The container would then be printed via a system.print.createPrintJob method call. Once the print job is executed the container title then would be set to “”.
How would I script this using the Plain Titled Border? I’d prefer to have no additional outlines on the print, just the caption (title).


The following script will do the trick. Took me a bit longer than I would like to admit to figure out how to get the container to repaint.

#a reference to the container
cont = event.source.parent.getComponent('Container')
#set the new border title
cont.border.title = 'Test'
#repaint the container imediately otherwise you may have to wait to see the title update

That works perfectly and is as simple as I would have expected it to be.
I just never found any reference to accessing properties of the border that way in any of the documentation or in my searching online.

This is a great community!
Thanks again!

Hi adding to title change

i want change title size also
how to write script for that
Area.border.titleFont = Font(‘Arial’, Font.BOLD, 50) - its not working

please help me out in this