# Scripting using a UDT Property

**URL:** <https://forum.inductiveautomation.com/t/scripting-using-a-udt-property/6633>\
**Category:** Ignition\
**Created:** [June 3, 2013, 4:52pm UTC](https://forum.inductiveautomation.com/t/scripting-using-a-udt-property/6633 "2013-06-03T16:52:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryankipp](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bryankipp](https://forum.inductiveautomation.com/u/bryankipp)\
**Post date:** [June 3, 2013, 4:52pm UTC](https://forum.inductiveautomation.com/t/scripting-using-a-udt-property/6633/1 "2013-06-03T16:52:27Z")

</div>

I have a UDT called “Motor\_Block” that I am trying to utilize on a template. I was originally using an indirect tag, but have changed to using a property of the UDT in a script.

The script is as follows:

x = system.tag.read (“event.source.parent.parent.MotorTag.PROG\_AUTO”)

if x.value is True:  
system.tag.write(“event.source.parent.parent.MotorTag.PROG\_AUTO”, 0)  
else:  
system.tag.write(“event.source.parent.parent.MotorTag.PROG\_AUTO”, 1)

When I run in Preview mode and click on the group associated with the script, I get the following error:

Traceback (most recent call last):

File “event:mouseClicked”, line 2, in

ValueError: Token PROPERTY\_SEPARATOR found after property name.

Ignition v7.6.1 (b2278)  
Java: Sun Microsystems Inc. 1.6.0\_45

Any assistance would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [June 3, 2013, 5:21pm UTC](https://forum.inductiveautomation.com/t/scripting-using-a-udt-property/6633/2 "2013-06-03T17:21:24Z")

</div>

You can’t reference a UDT custom property from outside the UDT. To get around it, create a memory tag in your UDT and set it’s value to the custom property, then reference the memory tag in your project.
