# How to script a component template name from tag instance

**URL:** <https://forum.inductiveautomation.com/t/how-to-script-a-component-template-name-from-tag-instance/11478>\
**Category:** Ignition\
**Created:** [April 6, 2016, 6:38pm UTC](https://forum.inductiveautomation.com/t/how-to-script-a-component-template-name-from-tag-instance/11478 "2016-04-06T18:38:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsteward](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jsteward](https://forum.inductiveautomation.com/u/jsteward)\
**Post date:** [April 6, 2016, 6:38pm UTC](https://forum.inductiveautomation.com/t/how-to-script-a-component-template-name-from-tag-instance/11478/1 "2016-04-06T18:38:29Z")

</div>

Is there any way to use a UDT tag instance name as the name of the drop target when instantiated? Currently when I drag a UDT tag onto a window the drop target component takes on the name of template. It would be great if I could make it take on the name of the UDT tag.

---

<div class="post-metadata">

**Author:** ![jeffkrol](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jeffkrol/32/3339_2.png) [@jeffkrol](https://forum.inductiveautomation.com/u/jeffkrol)\
**Post date:** [April 13, 2017, 3:38pm UTC](https://forum.inductiveautomation.com/t/how-to-script-a-component-template-name-from-tag-instance/11478/2 "2017-04-13T15:38:25Z")

</div>

While there is a way to do it, my solution requires scripting. I achieved this by making a template I can paste into a window/template (dubbed my “Magic Button”) that can trigger different python scripts using keystroke events. For example, when I press CTRL+ALT+J it will call functions to name some of my template instances based on the UDT parameter and CTRL+ALT+U will rename those templates back to generic names using a counter. I’m more than happy to give you more guidance on this if you’re still trying to figure this out.
