# Expression Script to check animate box in style customizer

**URL:** <https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [March 12, 2021, 4:44pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413 "2021-03-12T16:44:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.smith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david.smith/32/19391_2.png) [@david.smith](https://forum.inductiveautomation.com/u/david.smith)\
**Post date:** [March 12, 2021, 4:44pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/1 "2021-03-12T16:44:35Z")

</div>

Is there some way to be able to check the animate check box in the style customizer via a script?

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [March 12, 2021, 5:14pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/2 "2021-03-12T17:14:17Z")

</div>

Not that I’m aware of. What problem are you trying to solve?

---

<div class="post-metadata">

**Author:** ![david.smith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david.smith/32/19391_2.png) [@david.smith](https://forum.inductiveautomation.com/u/david.smith)\
**Post date:** [March 12, 2021, 5:15pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/3 "2021-03-12T17:15:39Z")

</div>

I’m trying to use a tag to trigger an animation (i.e. tag = 1, animation running, tag = 0 animation off)

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [March 12, 2021, 5:24pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/4 "2021-03-12T17:24:30Z")

</div>

![Tag](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7d9053c913ea4e9816af182ffd3cdb260c181326.jpeg)

Ideally, I think the tag should control the value (or custom property) of the component which then has an animation enabled or disabled.

For example, you could add a custom property to the component called ‘AnimationEnabled’.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 12, 2021, 5:33pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/5 "2021-03-12T17:33:33Z")

</div>

> [@bmeyers](#):
>
> For example, you could add a custom property to the component called ‘AnimationEnabled’.

This is the way.

In addition, if you _really_ need to do something dynamic with styles, you can just bind to the 'Styles' dataset property on any component that supports the Style Customizer. An animated style is just defined as a style with multiple rows for the same driving value.

---

<div class="post-metadata">

**Author:** ![david.smith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david.smith/32/19391_2.png) [@david.smith](https://forum.inductiveautomation.com/u/david.smith)\
**Post date:** [March 12, 2021, 5:38pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/6 "2021-03-12T17:38:19Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/0/205ff9bd8897cfba5cf3676c330da38ee344adb3.png)

This is for a log (rectangle) that I’m moving along an infeed belt. I have a custom property called infeed belt that is set to either a 1 or 0. Would using system.gui.transform within a script make more sense? I thought that I would be able to figure out a way to use a tag to check or uncheck the animate box.

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [March 12, 2021, 5:44pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/7 "2021-03-12T17:44:38Z")

</div>

![Animation](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/29aa67ac8d98c35194a2be5b2055038c49facb42.jpeg)

I setup a rectangle and added a property InFeedBelt and my animation works when I enable that property (InFeedBelt is set as a boolean).

Is yours not working?

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [March 12, 2021, 5:49pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/8 "2021-03-12T17:49:31Z")

</div>

In your picture you are using the ‘visible’ property to drive (change) the used properties InFeedBelt, X, and Y. Not sure that is what you meant to do. You want to use your InFeedBelt property to drive the X and Y properties instead.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [March 12, 2021, 6:15pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/9 "2021-03-12T18:15:34Z")

</div>

> [@paul-griffith](#):
>
> This is the way.

![s-l300](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/97bc4eefb4a94ea2ad139c4b19390cd0a90e0d61.jpeg)

😉

---

<div class="post-metadata">

**Author:** ![david.smith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david.smith/32/19391_2.png) [@david.smith](https://forum.inductiveautomation.com/u/david.smith)\
**Post date:** [March 12, 2021, 6:23pm UTC](https://forum.inductiveautomation.com/t/expression-script-to-check-animate-box-in-style-customizer/44413/10 "2021-03-12T18:23:40Z")

</div>

That was the problem, thanks for your help! 😄
