# Scripting Title Change for Container Component

**URL:** <https://forum.inductiveautomation.com/t/scripting-title-change-for-container-component/24948>\
**Category:** Ignition\
**Created:** [May 13, 2019, 9:04pm UTC](https://forum.inductiveautomation.com/t/scripting-title-change-for-container-component/24948 "2019-05-13T21:04:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [May 13, 2019, 9:04pm UTC](https://forum.inductiveautomation.com/t/scripting-title-change-for-container-component/24948/1 "2019-05-13T21:04:44Z")

</div>

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).

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 14, 2019, 2:30pm UTC](https://forum.inductiveautomation.com/t/scripting-title-change-for-container-component/24948/2 "2019-05-14T14:30:43Z")

</div>

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.

```auto
#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
cont.paintImmediately(cont.getVisibleRect())

```

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [May 14, 2019, 3:19pm UTC](https://forum.inductiveautomation.com/t/scripting-title-change-for-container-component/24948/3 "2019-05-14T15:19:31Z")

</div>

lrose,  
Thanks!  
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!  
Mike

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 18, 2021, 12:58pm UTC](https://forum.inductiveautomation.com/t/scripting-title-change-for-container-component/24948/5 "2021-03-18T12:58:03Z")

</div>

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
