Get custom property from window template will be placed on

How can I get a property from a window that a template will be placed on into a custom property of the template itself.

Example.
I create a custom property on the template - cp1
I also have a custom property on the window the template will be placed on - cp2

from the template editor how do i make sure that when i place the template into the window cp1 will equal whatever cp2 is without me having to manually link them

nevermind, figured it out. For anyone searching the forums in the future:

property = system.gui.getParentWindow(event).getComponentForPath(‘Root Container’).cp2
event.source.cp1 = property