# Creating a script for a circled shape based on a mouse click

**URL:** <https://forum.inductiveautomation.com/t/creating-a-script-for-a-circled-shape-based-on-a-mouse-click/104682>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [April 3, 2025, 9:48pm UTC](https://forum.inductiveautomation.com/t/creating-a-script-for-a-circled-shape-based-on-a-mouse-click/104682 "2025-04-03T21:48:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [April 3, 2025, 9:57pm UTC](https://forum.inductiveautomation.com/t/creating-a-script-for-a-circled-shape-based-on-a-mouse-click/104682/2 "2025-04-03T21:57:06Z")

</div>

First thing, post code, not pictures of code. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831). It helps immensely by allowing others to copy & paste code to try it instead of trying to read & type from a picture. You can edit your post by clicking the pencil icon in the bottom right

Create a custom property on the component called `selected` or `active` or similar, and bidirectionaly bind it to the value of the tag. In your click script, put `self.selected = not self.selected`. The bidirectional binding will take care of the rest.

I would highly recommend making this item a template and passing the expected tag path in as a parameter. You can then indirectly bind to the passed tag path.

---

_[View the full topic](https://forum.inductiveautomation.com/t/creating-a-script-for-a-circled-shape-based-on-a-mouse-click/104682)._
